Change colour of L.circleMarker()

It's probably a simple solution, but I'd like to change the colour of my L.circleMarkers from blue to green. Based on the documentation, it says you can pass it an options object to change things such as colour. What I tried is this:

return L.circleMarker(ll, {radius: number}, '#006600');

Passing it the hex colour code for green. I also tried to create an actual object like this:

var optionsObject = {color: "#006600"};

None of the methods I tried work. I'm relatively new to JavaScript and MapBox, and I would appreciate it if someone could help me out. Thanks!

Upvotes: 2

Views: 1895

Answers (2)

Tomy
Tomy

Reputation: 247

For change color circleMarker use NameCircle.setStyle({color: 'color name'});

Like this https://jsfiddle.net/magi2109/xd3Lmoqb/

circleMarker

my describtion link is this.

Upvotes: 0

Turns out you can just do something like:

return L.circleMarker(ll, {radius: number, color: '#006600'});

Upvotes: 2

Related Questions