Custom Marker Overlaid by Default Pin in MaplibreGL JS Versions After 3.1.0 #3925
-
I assume I'm missing something obvious, but I can't figure it out: while upgrading from MaplibreGL JS 3.1.0 to any newer version, the default map pin is constantly overlaid over any custom markers defined with CSS. maplibre-gl-js version: >3.1.0 browser: firefox, chromium ObservationIn Version 3.1.0 and earlier, I can define a custom map marker as follows: In HTML:
In the Script:
This works, but since >3.1.0, the standard pin is still overlaid. How do I get rid of it? Link to DemonstrationActual Behaviour: Custom Pin overlaid: Example with version 4.1.0: Expected behaviour: Example with version 3.1.0: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
According to the changelog, this was a non documented way of creating a marker. In general, we try and document changes in the changelog. |
Beta Was this translation helpful? Give feedback.
My bad, the example in "Add custom icons with Markers" actually works.
I need to pass the created
<div>
as an element in the constructor:See https://jsbin.com/danusugeqo/edit?html,output
Thanks for your help!! The other observation still stands, using addClassName keeps the default pin visible. I don't know if this is intended behaviour or not.