sfncook / ictracker_web

0 stars 0 forks source link

Google Maps Button #4

Open sfncook opened 9 years ago

sfncook commented 9 years ago

Add a button that says "Map" in the upper left corner near the incident type icon. Place it to the right of the icon. It should match the height and font size of all the other buttons across the top of the page. If the address is not set the map button should open Google maps anyway without an address. The button should open a map in a new tab of the browser (not a new window).

You'll need to encode the address and append it to the Google maps URL like this: https://www.google.com/maps/place/671+42nd+St,+Oakland,+CA+94609

You'll need to do just a bit of research on the URL encoding as it does not appear to be standard hexadecimal URL encoding.

Estimated time: 1.5 hours

AlexWroten commented 9 years ago

Just got this one done. I actually went through the Google Maps query URL: https://maps.google.com/?daddr=... because that way it will fill in the destination address field. If this behavior is undesired, the "daddr" can simply be "saddr" - and it turns out that in terms of querying the URL, regular encodeURI function works just fine. The plus is actually somewhat outdated, and Google automatically converts between them.

Let me know if this looks right for you!