Embedding google maps short urls is broken

Just see the results (short URL: https://goo.gl/maps/EOjie, long URL: Google Maps).

https://goo.gl/maps/EOjie

https://www.google.de/maps/place/New+York+City,+New+York,+USA/@40.7033127,-73.979681,11z/data=!3m1!4b1!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62

edit: The large map also does not show the location.

2 Likes

You need to choose the embed link, I think:

The ā€œshareā€ link doesnā€™t have enough data.

Just copy & paste the address from your browserā€™s address bar, no need to get a special link:

https://www.google.com/maps/place/New+York+City,+New+York,+USA/@40.6991485,-73.9989071,9z/data=!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62?hl=de

https://www.google.com/maps/place/New+York+City,+New+York,+USA/@40.6991485,-73.9989071,9z/data=!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62?hl=de

https://www.google.com/maps/@40.6964248,-74.0590794,12z?hl=de

https://www.google.com/maps/@40.6964248,-74.0590794,12z?hl=de

For google.de:
https://www.google.de/maps/@52.5153877,13.3792687,15z

https://www.google.de/maps/@52.5153877,13.3792687,15z

3 Likes

Yes, but you could argue that onebox should know how to expand short URLs. This is not a bug, though, but a feature request.

2 Likes

Actually, this is a bug. Short links are supposed to be resolved, but it doesnā€™t work for HTTPS.

I just canā€™t figure out why the shortened link in question resolves to a world map when embedded. It doesnā€™t make senseā€¦ from short ā†’ long ā†’ canonical:

  1. https://goo.gl/maps/EOjie
  2. https://www.google.de/maps/place/New+York+City,+New+York,+USA/@40.7033127,-73.979681,11z/data=!3m1!4b1!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62
  3. https://maps.google.de/maps?sll=40.7033127,-73.979681&sspn=0.3998584,0.7033743&cid=14414772292044717666&q=New+York+City,+New+York,+USA&dg=ntvb

All of these come straight from Google, the only alteration is that the third link has output=classic removed from its query parameters. It still works tho: paste any link into the address bar and it just works.

1 Like

This should fix it:

https://github.com/discourse/onebox/pull/280

Iā€™ve also added support for preview imagesā€¦ at least I hope. Iā€™m not certain if this kind of static map does actually require a Google API key.

3 Likes

Note: We have the iframe refreshing bug here, we need to implement a ā€˜previewā€™ onebox method.

ā€¦ you were saying? :grin:

Uhhā€¦ drafts? Delayed pressing of Reply! (thatā€™s the ticket)

Sorry, I probably shouldnā€™t engage in witty banter past 5am. Can I get that ninja-delete feature already? :wink:

Anyway, the PR above does include support for static preview images for the composer.

1 Like