Points of Interest
A PointOfInterest can display an image at any geographic coordinate. A common use case is to show a marker or pin representing a location that users can tap to get more information.
Custom POIs are AR-only for now.
addPoi,addPois,removePoiandremovePoisare onARPointOfInterestManageralone, because the map does not draw custom POIs yet. They come toMapPointOfInterestManagerwhen it does, as an addition that changes nothing for code written today. A POI added in AR belongs to the session, so aWemapMapViewsharing it lists it amonggetPois()andgetVisiblePois()without drawing it.
Add POI(s) in AR
To create a simple Point of Interest in AR, you have to provide at least its name, coordinate, and imageUrl.
val poi = PointOfInterest(
"Example POI",
Coordinate(43.610628, 3.876654),
imageUrl = "https://api.getwemap.com/images/pps-categories/icon_circle_maaap.png"
)
To add this newly created POI to the AR scene, provide it to the ARPointOfInterestManager:
geoARView.pointOfInterestManager.addPoi(poi)
To remove this POI later, use:
geoARView.pointOfInterestManager.removePoi(poi)
Make sure to remove only POIs you have added yourself. Many maps include POIs provided by the Wemap backend. Attempting to remove such POIs will result in an error, as this is not permitted.
Examples
For additional examples and sample implementations of WemapSDKs, visit the official GitHub repository.
Clone the repository and follow the README instructions to run the sample application.