Developer manual
Google Maps
When an html5 tag with the appropriate data-* attributes is embedded in a layout, Spring will search the current page for any <address> html tags and use the value of those tags to plot markers on a Google Map
Updated: Type: springtag
Method
data-spring-plugin
Current
Request Attributes
Attribute | Type | Description | Default | Required? | |
---|---|---|---|---|---|
current | id | string | id of html element Allowed values: valid id |
Y | |
current | data-spring-plugin | string | Triggers the Google Map plugin Allowed values: 'map' |
Y | |
current | data-map-zoom | string | The initial resolution at which to display the map is set by the zoom property, where zoom 0 corresponds to a map of the Earth fully zoomed out, and higher zoom levels zoom in at a higher resolution. Allowed values: number, 0-20 Currently this is overridden as the map will auto zoom to show all markers. |
10 | N |
current | data-map-type | list | Type of map to embed Allowed values: roadmap, hybrid, satellite, terrain |
roadmap | N |
Examples
#1
Request
<div id="map" data-spring-plugin="map" data-map-zoom="10" data-map-type="roadmap"> Loading... </div> ... <address>27 Clavering Road, Bayswater, Perth, WA</address>
When the above div with html5 data-* attributes is shown on a page, Spring will replace the div with a Google Roadmap using the settings from the data-* attributes and the address values of an html <address> fields on the current page.