Posted by gerdami on 31 Dec 2009 15:52, last edited by GoVegan on 09 May 2010 05:45
Tags: csi google javascript maps static
Introduction
You certainly know that you can embed a Google map that you can find at http://maps.google.com. But how can we embed maps automatically in page with copying and paste the code from Google.
Solutions
An easy one
This solution is based on the code to be embedded from http://maps.google.com. It uses an [[include…]] which contains [[embed]]1 instructions.
Default roadmap
[[include :csi:include:google-map-embed | location=Rue de la Loi 200, Brussels, Belgium |
domain=com | lang=en | width=600 | height=300 | zoom=14 ]]
Hybrid
[[include :csi:include:google-map-embed | location=Cairo, Egypt |
domain=com | lang=ar | width=600 | height=300 | zoom=5 | type=h ]]
Terrain
[[include :csi:include:google-map-embed | location=Mont Blanc, France |
domain=com | lang=fr | width=600 | height=300 | zoom=9 | type=p ]]
Parameters
- location=street, town, country
- domain=com or be, fr, de, it, …
- lang=en (default) or any ISO valid language code (fr, nl, it, pt, es, de, …)
- width and height in pixels
- zoom: from 0 (world) to 20 (street)
- type: nil for the default roadmap, h for hybrid, p for terrain
Other
- Available as CSI package no21
- Can be included into a live _template (location=%%title%%)
- Add your own map to the list of maps
Do not ask me how to disable the popup, I don't know (yet).
A static one
This version requires a free Google API key2, choose wikidot.com as valid domain.
A Javascript based one
This version requires a free Google API key, choose wdfiles.com as valid domain.
Do not ask me how to pass variables to the Javascript block, I don't know.
Links
Author
gerdami. Please visit his/her userPage.