mohamedmansour / hackathon-letsgo.io

letsgo.io - Photo Hack Day 4 project
http://letsgo.io
5 stars 6 forks source link

Is it feasible to save just the route line from the map? #19

Open jthiller opened 11 years ago

jthiller commented 11 years ago

Low importance on this question. I'm mostly curious about this as something that would open up possible design choices. Bing maps seems to embed the route as an SVG within the map, so I guess it could theoretically be done through some DOM manipulation, but something from the maps API might be cleaner.

Any thoughts? I wouldn't spend any time on this, but if you see something that looks useful along these lines I'd be curious to know about it.

LineOnly

SVG code: <path style="pointer-events: visiblepainted;" stroke="#3333ff" stroke-width="4" stroke-linecap="butt" stroke-dasharray="none" fill="none" fill-opacity="1" fill-rule="evenodd" stroke-opacity="0.7137254901960784" d="M730,363 L725,349 L708,344 L703,322 L698,312 L690,304 L688,285 L675,269 L675,260 L663,249 L659,232 L654,228 L646,212 L645,195 L637,188 L632,176 L631,167 L623,154 L615,129 L612,126 L603,126 L595,119 L591,108 L593,102 L590,89 L594,83 L580,68 L579,59 L572,53 L565,51 L564,46 L559,43 L559,35 L553,31 L554,18 L556,13 L565,7 L565,2 "></path>

SVG converted to PNG (GitHub doesn't like SVG): route_clean_converted

mohamedmansour commented 11 years ago

We can get the routes coordinates and render those, this answer has it http://stackoverflow.com/questions/7313182/how-extract-waypoint-route-from-bing-maps-directions-and-convert-it-to-a-shapefi

Is the purpose to share this route (which would be cool), we could just grab that DOM and manipulate then share. Our mapping algorithms should improve based on the route you take to your destination, so doing what they did in stackoverflow would be ideal (I think) /cc @justinormont

justinormont commented 11 years ago

It would be fun to be able to do a screen shot of the page, possibly server-side. Then use this as the image which gets posted to Facebook.

If you're just looking for the image, it's rather easy to render SVGs to an image. Just use any tool. There's tools for SVG=>HTML5 Canvas, or server side tools for SVG=>PNG.