Giter VIP home page Giter VIP logo

Comments (4)

maios avatar maios commented on June 11, 2024

Hi @bricepollock, thank you for writing in, by default PointAnnotationManager allows are icons and texts to be overlapping, this explains why you disable both textAllowOverlap and iconAllowOverlap but the annotations are still overlapping.

You can take a look at Label collision and let us know if it helps you achieve what you want. Additionally you can enable map's debugOptions as shown below to see how the annotations are overlapping

mapView.debugOptions = [.collision]

from mapbox-maps-ios.

persidskiy avatar persidskiy commented on June 11, 2024

My goal was to have text hidden when overlapping any part of another PointAnnotation, but always show the image.

@bricepollock Try this configuration:

manager.textAllowOverlap = false
manager.iconAllowOverlap = true
manager.textIgnorePlacement = false
manager.iconIgnorePlacement = false
manager.textOptional = true

from mapbox-maps-ios.

bricepollock avatar bricepollock commented on June 11, 2024

@persidskiy this is much closer to what I was going for, thank you! It wasn't clear that the placement properties were important since the Label Collision appeared to only reference map-elements as 'other symbols' in placement description.

Your config provided hidden text if it collides with other text. However, ideally, I want the text to be hidden whether it collides with either icon or text (like how MapKit works). Turning on iconAllowOverlap hides annotations for icon-collisions, which isn't the optionalText behavior I'm looking for. Avoiding overlaps would result in a lot cleaner map. Is there a way to configure 'hide text if collides with icon or text' or a mechanism to manage collision-hiding behavior for PointAnnotations manually?

Example of overlap:
Screenshot 2024-04-03 at 7 59 16 AM

from mapbox-maps-ios.

bricepollock avatar bricepollock commented on June 11, 2024

@persidskiy @maios would love any more details on collisions if you have some

from mapbox-maps-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.