Symbol Layer Icons become hidden with textfield
See original GitHub issueHi,
We are using SymbolLayer Infow Window code from the following url:
We have noticed that if we placed the symbols/ markers without TextField then the mapbox display more icons on the screen. For example if have we total 10 icons then on a specific zoom level without textfield, we can see 5 to 6 six icons. But with a textField the mapbox show only 2 to 3 icons, means it shows less icons. While we zoom in the map, then rest of the icons also displayed. Why the icons become hidden at the same zoom level? As we zoom out the map, the icons going to disappear, and shown again as we zoom in.
Any idea. Please see the following code.
if (isMarkerNameShowing) {
style.addLayer(new SymbolLayer(MARKER_LAYER_ID, GEOJSON_SOURCE_ID)
.withProperties(
iconImage("{markercolor}"),
PropertyFactory.textField("{name}"),
PropertyFactory.textColor(Color.RED),
PropertyFactory.textOffset(new Float[]{0f, 1f}),
PropertyFactory.iconIgnorePlacement(true),
iconAllowOverlap(false),
iconOffset(new Float[]{0f, -8f})
));
} else {
style.addLayer(new SymbolLayer(MARKER_LAYER_ID, GEOJSON_SOURCE_ID)
.withProperties(
iconImage("{markercolor}"),
PropertyFactory.iconIgnorePlacement(true),
iconAllowOverlap(false),
iconOffset(new Float[]{0f, -8f})
));
}
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to hide point labels at certain zoom levels in mapbox-gl-js?
I now add one layer that only shows the icons, and also add a second layer that only contains the labels. In this...
Read more >Add a Symbol layer to a map - Azure - Microsoft Learn
By default, symbol layers optimize the rendering of symbols by hiding symbols that overlap. As you zoom in, the hidden symbols become visible....
Read more >Icons appearing over a text box in their Normal states...
After reading the scenario, the user is instructed to double-click inside the text box in order for it to become Hidden again. They...
Read more >Layers | Style Specification | Mapbox GL JS
At zoom levels less than the minzoom, the layer will be hidden. ... corresponding icons when the icon collides with other symbols and...
Read more >The One Trick You Need to Master Sketch Layout🦸🏻♀️
By combining layer & text styles with Sketch's smart layout, ... Go to Symbols screen and make sure that you allow overrides for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@asifjavaid,
https://docs.mapbox.com/android/maps/examples/symbol-collision-detection allows you to play with the settings that @LukasPaczos describes above.
Hi, i wrote these lines of code based on mapbox-android-plugin-annotation-v8:0.7.0’ tutorial:
then, i saw my icon in defined latLng, but after i add this line of code: withTextField(“my text”), symbol icon disappears and not see any text on map. help me. result code after add that line of code: