Leaflet map with marker clustering and layer control not working or throwing errors.

202 views
Skip to first unread message

Amanuel Mekonnen

unread,
Dec 3, 2019, 8:06:57 PM12/3/19
to Leaflet
A mini version of my code is as follows: https://jsfiddle.net/pewqur17/1/. I've used layer control with clustering in another project before using the same technique. However, now the markers don't populate the map as they should. Any help would be appreaciated.

Pat Keller

unread,
Dec 4, 2019, 10:57:36 AM12/4/19
to Leaflet
It looks like you have a few problems with your code.
  1. Console errors
    1. Failed to load resource: the server responded with a status of 404 () Markercluster.css:1 
    2. Failed to load resource: the server responded with a status of 404 () Markercluster-Default.css:1 
    3. It looks like you didn't enter the file names correctly based on this https://unpkg.com/browse/leaflet.ma...@1.4.1/dist/
  2. The cluster shows up now, but it's in Antarctica. It looks like your latitude and longitude are reversed.
Reply all
Reply to author
Forward
0 new messages