nypl-spacetime / nypl-warper

NYPL Map Warper
MIT License
43 stars 13 forks source link

OSM Tile Export: Export Popup Tiles base url #64

Closed scspaeth closed 8 years ago

scspaeth commented 8 years ago

The OSM Tiles Export from the Export Tab works as intended. But the Export popup window that is linked from the Map description does not format the url correctly. I described the challenge in this post: http://buildinprogress.media.mit.edu/projects/3335/steps?step=20978 "A new map of New England, New York, New Iarsey, ... / by Philip Lea in Cheap-side, London. from Parts (In 4 layers) Depicts: 1690 Last modified 40 minutes ago. 10 control points. Version No.10 by Stephen Spaeth. 1 User also helped including: Rick Remove from My Maps | View on Digital Collections | Download KML | Kml logo 20x25 Export" Non-working url: http://maps.nypl.org/warper/maps/tile/12966/z/x/y Working url: http://maps.nypl.org/warper/maps/tile/12966/{z}/{x}/{y}.png I suspect that the problem lies in this line which inadequately specifies the full url: https://github.com/nypl-spacetime/nypl-warper/blob/a3ee028dbbafe1dcd2a6b43d5c52457cbc39fa45/app/views/shared/_export_window.html.erb#L45

mgiraldo commented 8 years ago

thanks for the find!

scspaeth commented 8 years ago

Still not resolved. When I copy the url from the popup link, it encoded the slashes and braces: http://maps.nypl.org/warper/maps/tile/12966/%7Bz%7D/%7Bx%7D/%7By%7D.png vs http://maps.nypl.org/warper/maps/tile/12966/{z}/{x}/{y}.png Apparently GeoJSON.io does not accept encoded links and it fails to render the rectified image. Still works for the Export tab.

mgiraldo commented 8 years ago

i guess the problem is using a link for that. maybe it should just be plain text as in the Export tab (because it's really not a link but a text template).

fwiw, if you do click the link, the URL in the window will be properly formatted (without %s). i will change it so that it is plain text and remove the link.