D
D
Danila Lozin2020-10-22 13:36:58
css
Danila Lozin, 2020-10-22 13:36:58

Leaflet markerclustergroup remove marker class on clustering, how to fix this?

How to assign a class to a marker within a cluster? In leaflet I use a marker filter depending on the classes (categories) assigned to them, hiding inappropriate ones. For markers with the same coordinates, I decided to use MarkerCluster. But classes disappear during clustering and filtering does not occur, but the cluster is not hidden when a category is selected. Maybe someone else knows how to update the number of cluster elements when filtering so that it works correctly?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
W
weranda, 2016-04-06
@ogarich89

https://jsfiddle.net/weranda/4ac7aphy/

V
Vlad Lavrik, 2016-04-06
@lavrok

If the background is plain - just fill the block with the text with the same color as the background.
If not, then the top cropped borders are separate elements, with position absolute, in order not to litter the HTML, it is better to use ::afrter and ::before pseudo-elements.

A
Alexey Zakharov, 2016-04-06
@konratnox

You can do this
https://jsfiddle.net/0aLfd3c8/1/

A
Alexander Miranovich, 2016-04-06
@aleks_664

jsfiddle.net/f48ZD/502 like this if you need it transparently as shown in your screenshot or as I previously wrote through the tag

D
Dmitry Khristoev, 2016-04-07
@Haoss

https://jsfiddle.net/haoss/9462drbj/

D
DSoly, 2016-04-07
@DSoly

Simple option:

<fieldset>
   <legend>Скидки за приглашение каждого участника</legend>
   <div>Содержимое блока</div>
</fieldset>

fieldset'u and legend'u can add the necessary classes with the desired styles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question