user982124
user982124

Reputation: 4610

MapKit JS - How to use mapkit.Annotation.CollisionMode.None

I'm having an issue with MapKit JS not showing the suburb name where a marker annotation is located. I've been advised to set the annotation’s collisionMode to None but I haven't been able to successfully apply this to my map.

Here's an example of a simple map I'm working with that I can't work out how to incorporate mapkit.Annotation.CollisionMode.None here:

    const main = async() => {
    await setupMapKitJs();
    
    // Create the Map and Geocoder
    const map = new mapkit.Map("map-container");
    const geocoder = new mapkit.Geocoder({ language: "en-US" });        
    
    // Create the "Marker" annotation, setting properties in the constructor.
    const event = new mapkit.Coordinate(-33.7015776, 151.0960029);
    const eventAnnotation = new mapkit.MarkerAnnotation(event, {
        color: "red",
        title: "",
        glyphText: "" 
    });
            
    // Add and show both annotations on the map
    map.showItems([eventAnnotation]);
        
};

main();

If someone could show me how to set the annotation's collisionmode to none that would be great - I've tried everything I can think of and nothing has made a difference here.

Upvotes: 0

Views: 29

Answers (0)

Related Questions