Log in
Log in with USB
Inloggen met vingerafdruk wordt binnenkort mogelijk.
Last change: August 24, 2020
Current version: 1.6.2
The googleMaps module provides your website with the options in the Google Maps javasript API, but simplyfied.
To use the googleMaps module you first use thei connect optiono to create and display a map. You can then use the send option to perform tasks on this map.
webanizr.collect('googleMaps', parameters, callback)
The googleMaps module accepts the following parameters:
Your Google Cloud API Key. You can get your own Google Cloud API key here.
The id of the dom element that will function as a wrapper for the Google Map.
The latitude of the location you want to center the map on.
The longitude of the location you want to center the map on.
The zoom level used when displaying the map.
If you want to perform actions on the map you need to give the map an id using this parameter. You then use this value in the send method to target this map.
A callback function to be called when the module is unable to calculate the route. It receives the error in the form { message__error : "the error message" }.
Boolean to either show or hide the zoom controls on the map.
Boolean to either show or hide the map type buttons on the map.
Boolean to either show or hide the scale option on the map.
Boolean to either show or hide the streetview button on the map.
Boolean to either show or hide the fullscreen button on the map.
Boolean to either show or hide the points of interests of type 'business' on the map.
If a text is supplied in this value, a marker will be placed in the center of the map. The text will be used as hint text.
Can be used in combination with text__marker. This parameter sets the animation of the shown marker. Valid options are:
The callback is called after the maps is shown on the page.
webanizr.send('googleMaps', data, parameters, callback)
The data needed to perform the requested action.
The send method of this module accepts the following parameters:
The map you want to target. The value must match the value given to id__map in the collect method.
The type of action you want to perform. The following values are supported:
The showroute action plots a route on the targeted map. To calcalate the route it looks for the key "points__route" in the data. The value for this key should be an Array containing all the stops of the route.
Adds geocoding.
Adds marker to an existing map. Can be used multiple times to add multiple markes to the same map. Possible parameters are:
latitude__marker: Latitude of the marker
longitude__marker : Longitude of the marker
(optional) content__markerinfo : Content inside the marker window. Can be set to any html.
(optional) title__marker: The text to show when the marker is hovered over with mouse.
Clears all the markers from a map.
Sets the zoom level. Parameter to use :
level__zoom
The callback is called when the action on the map is performed.
Show a map:
https://cdn.cpmodules.webanizr.com/demo/google-maps/index.html
Show a route:
https://cdn.cpmodules.webanizr.com/demo/google-maps-route/index.html
Link to play with with all possible map options and generate config file:
https://mapstyle.withgoogle.com/