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

[Feature request] SVG export #4

Closed
aguillien opened this issue Jan 20, 2020 · 15 comments
Closed

[Feature request] SVG export #4

aguillien opened this issue Jan 20, 2020 · 15 comments

Comments

@aguillien
Copy link

It would be super nice to have the ability to export the current map as svg instead of png.

Props for the work so far !

@ketz
Copy link

ketz commented Jan 20, 2020

+1

@grmain
Copy link

grmain commented Jan 20, 2020

I totally agree with this suggestion!

@acircleda
Copy link

Yes! If not SVG, vector PDF.

@Devetec
Copy link

Devetec commented Jan 21, 2020

Yes! This is needed.

@spidey000
Copy link

+1

@ktgvv
Copy link

ktgvv commented Jan 21, 2020

Yeah, agreed. I'd like to do some graphic art with those clean maps.

@anvaka
Copy link
Owner

anvaka commented Jan 22, 2020

Hello Friends!

I've added experimental support for this feature. May I ask you to play with it and tell me how it goes?

To enable the feature just add ?svg=1 to the query string. I.e. click here https://anvaka.github.io/city-roads/?svg=1 - there should be a new item to export as SVG (trying to keep it hidden, so that if there are any issues we don't set wrong expectations)

image

Would this work? Anything else is missing?

@patzi
Copy link

patzi commented Jan 22, 2020

Looks good to me, though I first couldn't see anything in inkscape. I had to zoom in or make the lines thicker, but it seems to work. Thanks

@grmain
Copy link

grmain commented Jan 22, 2020

Looks good too! Opened it in Inkscape, selected all the objects and applied a 1 px-wide solid color to the lines, exported it to a png and it's sooooo gorgeous. Each step required some time to Inkscape to process it because there are many many many objets to deal with, that seems normal to me.
Many thanks anvaka, I really appreciate your work :)

@lagerkoller
Copy link

Works fine for me, thanks. However, the colors are ignored (always black and white). And there is no city label.

An additional rather small issue: at the end of each path's d attribute value there is an unnecessary space: ""

@acircleda
Copy link

The SVG pulls the view that I select (zoom level, placement), but its just black lines on a white bg.

@jeroentvb
Copy link

Downloading as svg doesn't work for me on Safari, macOS 10.15.2. I made sure ?svg=1 was in the url.
I tried it in chrome and it worked.

@nonoesp
Copy link

nonoesp commented Jan 23, 2020

@jeroentvb make sure you're appending &svg=1 if there are other arguments in the URL (e.g. https://anvaka.github.io/city-roads/?q=malaga%2C%20spain&areaId=3605275848&svg=1 and not https://anvaka.github.io/city-roads/?q=malaga%2C%20spain&areaId=3605275848?svg=1).

@puchok
Copy link

puchok commented Jan 23, 2020

this ist really cool with .svg! Many thanks. Testet with chrom - it works

@anvaka
Copy link
Owner

anvaka commented Jan 24, 2020

Thank you for the feedback! This is done now. Here is side by side rendering of city roads and an exported svg (both rendered by google chrome):

image

Still need to look into Safari export error, but otherwise this change supports colors and labels customization. Hope this works for you too! Please open a new issue if you find anything missing or broken.

Thanks again for the inspiration :).

@anvaka anvaka closed this as completed Jan 24, 2020
@JacqueH JacqueH mentioned this issue Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests