Searching
Retrieve Specific Location: getLocation(id)
getLocation(id)Use-Case 1: Center the Map to the Location
Example 1: Using MapsIndoors Location ID on the Card
card.addEventListener('click', () => {
const locationId = card.getAttribute('data-location-id'); // Assume the MapsIndoors ID is stored in a data attribute
mapsindoors.services.LocationsService.getLocation(locationId).then(location => {
mapsIndoorsInstance.setFloor(location.properties.floor);
mapInstance.setCenter({
lat: location.properties.anchor.coordinates[1],
lng: location.properties.anchor.coordinates[0]
});
mapInstance.setZoom(18);
});
});Example 2: Using an External Custom ID on the Card
Use-Case 2: Utilizing MapsIndoors SDK Highlighting and Filtering
Use-Case 3: Modify Display Rule
Example 1: Customizing Display Rule on Click Event with MapsIndoors Location ID
Example 2: Using an External Custom ID
Use-Case 4: Add a Popup / Info Window
Retrieve Queried Locations: getLocations(args opt)
getLocations(args opt)Parameter
Type
Optional/Required
Description
Default / Example
Code Example
Example of Creating a Search Query
Display Search Results on the Map
Example of Filtering the Map to Display Searched Locations on the Map
Clearing the Map of Your Filter
Example of Clearing Your Map Filter to Show All Locations Again
Display Locations as List
Search example
Checking for Results
Last updated
Was this helpful?