not save marker icon class when zoom
See original GitHub issue- Leaflet version 0.77
- Leaflet.MarkerCluster version 0.72
- Browser (with version) I’m using: all (ex. chrome 55.0.2883.87 (64-bit))
- OS/Platform (with version) I’m using: Ubuntu 16.04
I am using markercluster plugin step 1 I create marker
var marker = L.marker(
[this.lat, this.lon],
{icon: icon, zIndexOffset: 100,
riseOnHover: true}
);
step 2 Add marker to clustering
step 3
Wnen click to marker, i add className to marker
marker._icon.className = marker._icon.className + ' visited';
the className will change(will add ‘visited’ className)
step 4. zoom ‘-’ in map, marker’s icons hide in map and clustering icon is show step 5. zoom ‘+’ in map, clustering icon is hide, marker’s icons is show
But clicked marker will not save new classname ‘visited’
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Prevent marker from scaling when zoom out - Stack Overflow
Based on your comment: Yes, you can solve it with a marker, but there is no 'ready-to-use' option in the MarkerOptions.
Read more >Show/hide markers depending on zoom-level [duplicate]
I would like to show icons if the user zooms to level 7 or more and hide the markers when zoom level is...
Read more >Enabling or disabling annotation tools for meetings
Sign in to the Zoom web portal. · In the navigation panel, click Settings. · Click the Meeting tab. · Under In Meeting...
Read more >Scaling markers with zoom - Google Groups
MarkerClusterer. It won't scale your icons, but it will "group" icons ... save by looping through every marker when zoom level is changed...
Read more >Info Windows | Maps JavaScript API - Google Developers
Typically you will attach an info window to a marker, but you can also attach an info window to a ... The InfoWindow...
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 FreeTop 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
Top GitHub Comments
That isn’t a supported way to add classes to icons. That hack won’t work with markercluster as we remove and add markers from the map, when this happens the class will be removed (You can reproduce this by setting the class, removing the marker from the map then re-adding it). You need to change the classes properly if you want them to be maintained.
Use marker.setIcon to change the icon