Google Maps Widget

From Hexten

Jump to: navigation, search

The Google Maps Widget is a Wiki Widget that makes it easy to embed a Google map on a wiki page. Markers may be added to the map using simple markup.

Contents

[edit] Example

Here's an example

 
  <widget type="googlemap" debug="0" disabled="0">
      <marker lat="54.787397" lon="-2.342880">
        [http://www.overwaterlodge.co.uk/ The Overwater Lodge]
      </marker>
      <marker lat="54.788097769754415" lon="-2.342190742492676">
        [http://www.nenthead.com/ The Miners Arms]
      </marker>
      <marker lat="54.786446002226384" lon="-2.3415684700012207">
        [http://www.npht.com/nentheadmines/ Nenthead Mines]
      </marker>
      <marker lat="54.787837945626485" lon="-2.342137098312378">
        Play area
      </marker>
  </widget>
  

and here's what it looks like

Errors from Google Maps Widget

The following errors occurred:

Mandatory config key api_key not defined

That extra control (the ? icon) pops up a window containing the markup you need to add a marker at the centre of the map. Click on it to see what it does.

[edit] Reference

[edit] Parameters

debug
display debug information for the widget (default 0)
disabled
temporarily disable display of widget (default 0)
width
sets the width of the embedded map in pixels (default 500)
height
sets the height of the embedded map in pixels (default 300)
lat
sets the latitude for the centre of the map
lon
sets the longitude for the centre of the map
zoom
sets the zoom level for the centre of the map

If lat, lon and zoom are omitted the map will appear zoomed right out. If you add markers to the map you should usually omit lat, lon and zoom and allow the map to be centred and zoomed automatically.

[edit] Markers

Markers are added to the map using the <marker> tag:

 
  <widget type="googlemap">
      <marker lat="54.787397" lon="-2.342880">
        [[The Overwater Lodge]]
      </marker>
      <marker lat="54.788097769754415" lon="-2.342190742492676">
        [[The Miners Arms]]
      </marker>
  </widget>
  

Each marker must have lat and lon parameters that specify its position. If there is any text between <marker> and </marker> the marker will have a label containing the text. Wiki markup may be used. To view the text click on the marker.

[edit] Creating Markers

In addition to the normal Google maps control there's an extra button marked with a question mark. When you click on that button you will see a popup containing the markup for a new marker at the centre of the map. Copy & paste that markup into the page source to add the marker permanently.

[edit] See Also

[edit] Contribute

If you have ideas about the editing can be improved (I know it can be improved) please visit Widget Editing and dump your ideas there.

Personal tools
Mongers