Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directory compatibility for linux #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Converter/Converter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
Expand Down Expand Up @@ -349,8 +350,10 @@ private void CreateGlobals(string style)
AppendLine("filtering: mipmap");
AppendLine("sprites:");
_indent++;

var sprites = SpriteConverter.GetSprites($"{AppDomain.CurrentDomain.BaseDirectory}\\Styles\\{style}\\sprite\\{style}{variant}.json");
var style_name = style + variant + ".json";
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Styles", style,"sprite",style_name);
var sprites = SpriteConverter.GetSprites(path);
//var sprites = SpriteConverter.GetSprites($"{AppDomain.CurrentDomain.BaseDirectory}\\Styles\\{style}\\sprite\\{style}{variant}.json");
foreach (var sprite in sprites)
AppendLine($"{sprite.Name}: [{sprite.X},{sprite.Y},{sprite.Width},{sprite.Height}]");

Expand Down
5 changes: 4 additions & 1 deletion FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ private void Form1_Load(object sender, EventArgs e)
private void ReadFile(string style)
{
_style = style;
var style_name = _style + ".json";
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Styles", _style , style_name);
var lines = File.ReadAllLines(path);

var lines = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + @"\Styles\" + _style + "\\" + _style + ".json");
//var lines = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + @"\Styles\" + _style + "\\" + _style + ".json");
textBoxIn.Lines = lines;
Process();
}
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# jsontoyaml
Winforms app to convert Mapbox GL JSON styles to Mapzen YAML styles

#Linux
Use [MonoDevelop](https://www.monodevelop.com/) to edit / open /build it

once you run build all

Build -> Build All

you will get MbJsonToYaml.exe file on the

bin/Release

Run it using Mono