Google Maps
(part of package 'googlemaps') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent
This is a reference page; many components have detailed usage guides here.
Properties
KmlLayerURL
Type: Dataprovider
apiKey
Type: Dataprovider
directionsSettings
Type: CustomType<googlemaps-svy-G-Maps.routeSettings>
fullscreenControl
Type: Boolean Default Value: true
gestureHandling
Type: String Default Value: "auto"
mapEvents
Type: Array<String>
mapType
Type: String Default Value: "ROADMAP"
mapTypeControl
Type: Boolean Default Value: true
markerEvents
Type: Array<String>
markers
Type: Array<CustomType<googlemaps-svy-G-Maps.marker>> Default Value: []
responsiveHeight
GMaps height to be set in a responsive form. When responsiveHeight is set to 0, the component will use 100% height of the parent container
Type: Number Default Value: 300
streetViewControl
Type: Boolean Default Value: true
styleClass
Type: Styleclass
useGoogleMapCluster
Type: Boolean Default Value: false
useGoogleMapDirections
Type: Boolean Default Value: false
visible
Type: Visible
zoomControl
Type: Boolean Default Value: true
zoomLevel
Type: Dataprovider
Events
onMapEvent(event,latLng)
Parameters:
{JSEvent} event
onMarkerEvent(event,markerIndex,latLng)
Parameters:
onMarkerGeocoded(marker,latLng)
Parameters:
onRouteChanged(routeDetails)
Parameters:
{CustomType<googlemaps-svy-G-Maps.routeResult>} routeDetails
API
addMarker(marker,index)
Adds the given marker
Parameters:
{CustomType<googlemaps-svy-G-Maps.marker>} marker The marker object to add.
{Number} [index] Starting point where to add the marker (useful to add waypoints in routes in a specific order)
addMarkers(markers,index)
Adds the given markers
Parameters:
{Array<marker>} markers An array of marker objects to add.
{Number} [index] Starting point where to add the markers (useful to add waypoints in routes in a specific order)
centerAtAddress(address)
Center google maps at the given address
Example:
Parameters:
{String} address The address to center the map on.
Returns: Boolean True if the map was successfully centered; otherwise, false.
centerAtLatLng(lat,lng)
Center google maps at LatLng
Example:
Parameters:
Returns: Boolean True if the map was successfully centered; otherwise, false.
createMarker(markerId,addressOrLatLng,title)
Creates a new, empty marker with the given marker ID and position
Parameters:
Returns: CustomType<googlemaps-svy-G-Maps.marker> The created marker object.
fitBounds(latLngBounds)
Sets the viewport to contain the given bounds.
Parameters:
{Object} latLngBounds The bounds to fit within the viewport.
getBounds()
Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the
bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized (i.e.
the mapType is still null), or center and zoom have not been set then the result is null
or undefined
.
Returns: CustomType<googlemaps-svy-G-Maps.latLngBounds> The latitude/longitude boundaries of the current viewport.
getCenter()
Returns the position displayed at the center of the map
Returns: CustomType<googlemaps-svy-G-Maps.latLng> The latitude/longitude position at the center of the map.
getMarker(index)
Returns the marker with the given index
Parameters:
{Number} index The index of the marker to retrieve.
Returns: CustomType<googlemaps-svy-G-Maps.marker> The marker object at the specified index.
getMarkerById(markerId)
Returns the marker with the given markerId
Parameters:
{Object} markerId The unique identifier of the marker.
Returns: CustomType<googlemaps-svy-G-Maps.marker> The marker object with the specified ID.
getMarkers()
Returns all markers
Returns: Array<CustomType<googlemaps-svy-G-Maps.marker>> An array containing all marker objects currently displayed on the map.
newMarkers(markers,index)
Add a new google marker to the map
Example:
@deprecated please use addMarkers(markers, index)
instead
Parameters:
{Array<marker>} markers An array of marker objects to add.
{Number} [index] Starting point where to add the markers
refresh()
Refresh google maps
Example:
Returns: Boolean True if the map was successfully refreshed; otherwise, false.
removeAllMarkers()
Remove all google markers
Example:
Returns: Boolean True if all markers were successfully removed; otherwise, false.
removeMarker(index)
Remove google marker at given index
Example:
Parameters:
{Number} index The index of the marker to remove.
Returns: Boolean True if the marker was successfully removed; otherwise, false.
setOptions(options)
Set Google Maps options. See here: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions the list of available options.
Parameters:
{Object} options The configuration options for customizing the map.
Types
latLng
scripting type: CustomType<googlemaps-svy-G-Maps.latLng>
latLngBounds
scripting type: CustomType<googlemaps-svy-G-Maps.latLngBounds>
leg
scripting type: CustomType<googlemaps-svy-G-Maps.leg>
distance
Type: string
distance_meters
Type: int
duration
Type: string
duration_seconds
Type: int
end_address
Type: string
end_markerId
Type: object
start_address
Type: string
start_markerId
Type: object
marker
scripting type: CustomType<googlemaps-svy-G-Maps.marker>
addressDataprovider
Type: dataprovider
addressString
Type: string
animation
Type: string
Default Value: null
clickable
Type: boolean
Default Value: true
crossOnDrag
Type: boolean
Default Value: true
cursor
Type: string
draggable
Type: boolean
Default Value: false
drawRadius
Type: boolean
Default Value: false
iconLabel
Type: string
iconMedia
Type: media
iconUrl
Type: string
infoWindowString
Type: tagstring
latitude
Type: double
longitude
Type: double
markerId
Type: object
opacity
Type: double
Default Value: 1
position
Type: latLng
radiusColor
Type: color
Default Value: "#AA0000"
radiusMeters
Type: int
Default Value: 2000
title
Type: string
tooltip
Type: string
userObject
Type: object
visible
Type: boolean
Default Value: true
zIndex
Type: int
routeResult
scripting type: CustomType<googlemaps-svy-G-Maps.routeResult>
routeSettings
scripting type: CustomType<googlemaps-svy-G-Maps.routeSettings>
avoidFerries
Type: boolean
Default Value: false
avoidHighways
Type: boolean
Default Value: false
avoidTolls
Type: boolean
Default Value: false
optimize
Type: boolean
Default Value: true
travelMode
Type: string
Default Value: "driving"
Last updated
Was this helpful?