MapViewController

Here's an example on how to use this controller class:

JAVASCRIPT

cordova.plugins.MapView.onLoad((controller: any) => { // Once the MapView was loaded you can start managing our map by: // 1. Sending actions like selecting or navigating to a POI in a building: // controller.selectPoi('YOUR_POI_IDENTIFIER'); // controller.navigateToPoi('YOUR_POI_IDENTIFIER'); // 2. Listen to events that take place inside our map like a POI being selected or deselected: controller.onPoiSelected((poiSelectedResult: any) => { console.log("EXAMPLE> onPoiSelected -> ", poiSelectedResult); }); controller.onPoiDeselected((poiDeselectedResult: any) => { console.log("EXAMPLE> onPoiDeselected -> ", poiDeselectedResult); }); });

Methods

static navigateToPoi(identifier, accessibilityMode)

Allows you to navigate to a POI programmatically in your venue. This will cause the MapView to start navigation mode displaying the route between the user's location and the POI specified by parameters. The types of accessibilityMode you can use are: - 'CHOOSE_SHORTEST' : Calculates the shortest route to the destination POI. - 'ONLY_ACCESSIBLE' : Calculates the shortest route to the destination POI but avoiding stairs and prioritizing accessible floor changes such as lifts. - 'ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES' : Calculates the shortest route to the destination POI but avoiding lifts and prioritizing non-accessible floor changes such as stairs. accessibilityMode defaults to CHOOSE_SHORTEST.
Parameters:
Name Type Description
identifier number The identifier of the POI.
accessibilityMode 'CHOOSE_SHORTEST' | 'ONLY_ACCESSIBLE' | 'ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES' | undefined Choose the route type to calculate.

static onPoiDeselected(cb)

Informs you, through the function you pass as callback (cb), that a POI was deselected in your building.
Parameters:
Name Type Description
cb function A callback that returns a PoiDeselectedResult by its parameters.

static onPoiSelected(cb)

Informs you, through the function you pass as callback (cb), that a POI was selected in your building.
Parameters:
Name Type Description
cb function A callback that returns a PoiSelectedResult by its parameters.

static selectPoi(identifier)

Allows you to select a POI programmatically in your venue. This will cause the MapView to center the view on that POI and show its information.
Parameters:
Name Type Description
identifier number The unique identifier of the resource.

static setDirectionsOptions(directionsOptions)

If you want to change the route calculated based on tags you can use this interface. Using this interface you can change all the routes that will be calculated including or excluding tags. Use the method this method after the MapView ends loading You can call this as many times you want and the mapviewer will use the last options that you set.
Parameters:
Name Type Description
directionsOptions MapViewDirectionsOptions the desired MapViewDirectionsOptions

static setLanguage(language)

Allows you to change the initial language that <map-view> uses to display its UI. Checkout the Situm docs to see the list of supported languages.
Parameters:
Name Type Description
language string an ISO 639-1 code.