Points of Interest
Display and manage markers at geographic coordinates.
Overview
A PointOfInterest shows an image at a geographic coordinate — typically a marker or pin the user
can tap for more information.
Custom POIs are AR-only for now. addPOI(_:), addPOIs(_:), removePOI(_:) and removePOIs(_:) are on
ARPointOfInterestManaging alone, because the map does not draw custom POIs yet. They come to
MapPointOfInterestManaging when it does, as an addition that changes nothing for code written
today. A POI added in AR belongs to the session, so a MapView sharing it lists it among getAllPOIs() and
getVisiblePOIs() without drawing it.
Adding POIs in AR
Create a POI with at least a name, a coordinate, and an imageURL:
let poi = PointOfInterest(
name: "Example POI",
coordinate: Coordinate(coordinate2D: .init(latitude: 43.610628, longitude: 3.876654)),
imageURL: "https://api.getwemap.com/images/pps-categories/icon_circle_maaap.png"
)
Add it to the AR scene through arView.pointOfInterestManager:
_ = arView.pointOfInterestManager.addPOI(poi)
Remove it later with:
_ = arView.pointOfInterestManager.removePOI(poi)
Only remove POIs you added yourself. Many maps include POIs provided by the Wemap
backend; attempting to remove those returns false — it isn't permitted.