Embedding an embedding custom map?

86 views
Skip to first unread message

Morbus Iff

unread,
Apr 19, 2012, 5:35:40 PM4/19/12
to google-map...@googlegroups.com
G'day. I've been hard-at-work at a not-yet-public custom Google Map. It uses custom tiles to present an entirely fictional map, similar in scope to mapwow.com. My question is: can I let other folks embed my custom map on their own sites? That is, I want to allow them to set the viewport size, or center on a particular destination, etc. I've been unable to find any decent results for such a question - most are just results for (Google > My Site) not (Google > My Site > Your Site).

xelawho

unread,
Apr 20, 2012, 11:39:03 AM4/20/12
to Google Maps JavaScript API v3
> My question is: can I let other folks embed my custom map on their own sites?

the "embed this map" feature on google maps simply creates an iframe.
Here's the source I get by default:

<iframe width="425" height="350" frameborder="0" scrolling="no"
marginheight="0" marginwidth="0" src="http://maps.google.com.gt/maps?
hl=es&amp;ie=UTF8&amp;ll=15.778464,-90.224424&amp;spn=5.294799,9.876709&amp;t=m&amp;z=7&amp;output=embed"></
iframe><br /><small><a href="http://maps.google.com.gt/maps?
hl=es&amp;ie=UTF8&amp;ll=15.778464,-90.224424&amp;spn=5.294799,9.876709&amp;t=m&amp;z=7&amp;source=embed"
style="color:#0000FF;text-align:left">Ver mapa más grande</a></small>

so basically everything between the iframe tags is what you want to
replicate, obviously swapping in your own url for google's. Everything
after the ? in the iframe src is a query string that tells your map
what to do as it gets embedded.

there's plenty of stuff about query strings online. you will need to
set permissions so that cross-domain requests are possible as some
browsers require this before loading iframe content from a different
domain.

Morbus Iff

unread,
Apr 20, 2012, 12:26:34 PM4/20/12
to google-map...@googlegroups.com

Thanks! That's what I surmised at when I wrote up the
StackOverflow version, which still hasn't been answered yet ;)

http://stackoverflow.com/questions/10237305/how-do-i-allow-others-to-embed-my-custom-google-map

Free points over there if you want to paste it in.

--
Morbus Iff ( small pieces of morbus loosely joined )
http://www.disobey.com/ and http://www.disobey.com/wiki/
twitter: @morbusiff / skype: morbusiff / irc.freenode.net, Morbus
An O'Reilly author and blogger: http://www.oreillynet.com/pub/au/779

Reply all
Reply to author
Forward
0 new messages