Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

505
Views
change Leaflet circleMarker ,to any custom icon (large data)

enter image description here I load about 10K L.circleMarker on the leaflet map and its works great. I try to change the icon of the circle to anything but I cant I know that I can change the icon in the regular marker but I don't, know how can I change the L.circleMarker.

can't find any doc about changing circle markers: https://leafletjs.com/reference.html#circlemarker

I want to get a result something like this but with different shapes of circle markers: enter image description here

ill be thankful if you have any experience to share

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is not possible for L.circleMarker to load an icon directly. I have been in similar situation and used a bit of hack combining L.circle and L.marker. I need to specify radius in meters didn't know how to convert it to pixels. L.circleMarker allows to specify Radius of the circle marker, in pixels. L.circle allows to specify Radius of the circle, in meters.

try this function to set leftlet icon to any other icon :

You can take detailed reference from here (https://leafletjs.com/reference.html#icon)

function setLeafLetIcon(icon, marker) {
        var myIconReplc = L.Icon.extend({
            options: {
                iconUrl: icon, // icon image url here
                iconSize: [20, 24],
                iconAnchor: [10, 24]

            }
        });
        marker.setIcon(new myIconReplc);
    
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!