MapEventListener

MapEventListener

new MapEventListener()

You can register to listen to the SteerpathMap events with the example below. In this table you can find all the supported events
Example
window.steerpath.MapEventListener.on("onMapClick", function (e) {
console.log("onMapClick ", e)
});
Properties:
Name Type Description
onMapClick event Fired when POI is clicked. Returns the original click event and the clicked POI
Properties
Name Type Description
event object The original click event.
mapClickFeatures array List of clicked features.
mapObjects array List of SmartMapObjects created based on clicked features.
onSearchResultSelected event Fired when search result is selected from the list view.
Properties
Name Type Description
payload.mapObject object Selected SmartMapObject.
mapboxMapCreated event When Mapbox map instance is created this event is fired.
Properties
Name Type Description
event object The original click event.
mapboxMap object Reference to the instance of the mapbox map created by the class
steerpathMap object Reference to the instance of the steerpath map class created by the class
steerpathMapLoaded event When the canvas is rendered, style is loaded and the tiles are rendered the map is loaded.
Properties
Name Type Description
event object The original click event.
mapboxMap object Reference to the instance of the mapbox map created by the class
steerpathMap object Reference to the instance of the steerpath map class created by the class
steerpathMapCreated event desc
Properties
Name Type Description
event object The original click event.
mapboxMap object Reference to the instance of the mapbox map created by the class
steerpathMap object Reference to the instance of the steerpath map class created by the class
onThemeSet event Fired when theme is set
Properties
Name Type Description
event object Event object telling if setting theme was successful or had errors
onLanguageSet event Fired when language is set.
Properties
Name Type Description
event object Event object telling if setting language was successful or had errors
onSearchCategorySelected event Fired when language is set.
Properties
Name Type Description
event object Event object telling the search results
steerpathBuildingExit event Fired when building is no longer the active building
Properties
Name Type Description
buildingExited object The building JSON for the building which is no longer the current active building.
steerpathBuildingEntered event Fired when a building becomes the active building
Properties
Name Type Description
enteredBuilding object The building JSON for the building which has become the current active building.
steerpathBuildingAnalysed event Fired when API has analysed building in the view.
Properties
Name Type Description
analysedBuilding object Analysed building object.
steerpathBeforeBuildingChanged event Fired when entering a building not seen before.
Properties
Name Type Description
buildingBeforeChange object Previous building object.
newActiveBuilding object New entered building object.
layerIndexBeforeChange number Previous building"s layer index.
steerpathBuildingChanged event Fired when entering building not seen before.
Properties
Name Type Description
newActiveBuilding object New entered building object.
newLayerIndex number New layer index.
steerpathBeforeLayerIndexChanged event Fired before building"s layer index changes
Properties
Name Type Description
buildingRef string Buildings reference string
layerIndexBeforeChange number Buildings old layer index.
newLayerIndex number Buildings new layer index.
steerpathLayerIndexChanged event Fired when buildings layer index has changed.
Properties
Name Type Description
buildingRef string Buildings reference string.
newLayerIndex number New layer index.
steerpathRouteAdded event Fired when route is added to the map.
Properties
Name Type Description
routeManager Instance of RouteManager
steerpathRouteRemoved event Fired when route is removed from the map
Properties
Name Type Description
routeManager Instance of RouteManager
steerpathRouteAnimationStarted event Fired when route animation has started
Properties
Name Type Description
routeAnimationManager event Instance of RouteAnimationManager
steerpathRouteAnimationStopped event Fired when route animation has stopped
Properties
Name Type Description
routeAnimationManager event Instance of RouteAnimationManager
steerpathRouteAnimationFinished event Fired when route animation has reached its destination
Properties
Name Type Description
routeAnimationManager event Instance of RouteAnimationManager
steerpathRouteAnimationPreviewStopped event Fired when route preview animation has stopped
Properties
Name Type Description
routeAnimationManager event Instance of RouteAnimationManager
steerpathLongTouch event Fired when long touch gesture happens with touch screen devices.
Properties
Name Type Description
longTouchEvent object Event object containing both LngLat and XY coordinates of the touch event.
building object Building in the touch location if there was one.