# Embedding google maps short urls is broken

**URL:** https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615
**Category:** Feature
**Created:** [March 21, 2015, 10:12pm UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615 "2015-03-21T22:12:26Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![rumpelsepp](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rumpelsepp](https://meta.discourse.org/u/rumpelsepp)
#### Post date: [March 21, 2015, 10:12pm UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/1 "2015-03-21T22:12:27Z")

</div>

Just see the results (short URL: [Google Maps](https://goo.gl/maps/EOjie), long URL: [Google Maps](https://www.google.de/maps/place/New+York+City,+New+York,+USA/@40.7033127,-73.979681,11z/data=!3m1!4b1!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62)).

https://maps.google.com/maps?ll=40.7033127,-73.979681&z=11&output=embed&dg=ntvb&q=New+York+City,+New+York,+USA&cid=183113156461472272763979745050884570722

https://maps.google.com/maps?ll=40.7033127,-73.979681&z=11&output=embed&dg=ntvb&q=New+York+City,+New+York,+USA&cid=183113156461472272763979745050884570722

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

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 21, 2015, 11:57pm UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/2 "2015-03-21T23:57:17Z")

</div>

You need to choose the `embed` link, I think:

https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387157.48218081944!2d-73.97968099999999!3d40.703312749999995!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c24fa5d33f083b%3A0xc80b8f06e177fe62!2sNew+York%2C+NY!5e0!3m2!1sen!2sus!4v1426982206723

The “share” link doesn’t have enough data.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 22, 2015, 1:09am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/3 "2015-03-22T01:09:46Z")

</div>

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://maps.google.com/maps?ll=40.6991485,-73.9989071&z=9&output=embed&dg=ntvb&q=New+York+City,+New+York,+USA&cid=183113156461472272763979745050884570722

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

https://maps.google.com/maps?ll=40.6964248,-74.0590794&z=12&output=embed&dg=ntvb

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

https://maps.google.com/maps?ll=52.5153877,13.3792687&z=15&output=embed&dg=ntvb

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 22, 2015, 2:23am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/4 "2015-03-22T02:23:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 22, 2015, 3:34am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/5 "2015-03-22T03:34:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 22, 2015, 3:53am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/6 "2015-03-22T03:53:03Z")

</div>

This should fix it:

[https://github.com/discourse/onebox/pull/280](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.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 22, 2015, 4:06am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/7 "2015-03-22T04:06:14Z")

</div>

Note: We have the iframe refreshing bug here, we need to implement a ‘preview’ onebox method.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 22, 2015, 4:09am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/9 "2015-03-22T04:09:01Z")

</div>

> [@elberet](#):
>
> I’ve also added support for preview images

… you were saying? 😁

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 22, 2015, 4:10am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/10 "2015-03-22T04:10:06Z")

</div>

> [@elberet](#):
>
> > [@elberet](#):
> >
> > I’ve also added support for preview images
> 
> … you were saying? 😁

Uhh… drafts? Delayed pressing of Reply! (that’s the ticket)

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 22, 2015, 4:14am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/11 "2015-03-22T04:14:29Z")

</div>

Sorry, I probably shouldn’t engage in witty banter past 5am. Can I get [that ninja-delete feature](https://meta.discourse.org/t/deleting-a-newly-created-post-inconsistent-behaviour/26103) already? 😉

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

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [March 25, 2015, 6:40am UTC](https://meta.discourse.org/t/embedding-google-maps-short-urls-is-broken/26615/12 "2015-03-25T06:40:29Z")

</div>


