Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Different Color for a set of markers #83

Open
rananaresh86 opened this issue Dec 28, 2020 · 1 comment
Open

Set Different Color for a set of markers #83

rananaresh86 opened this issue Dec 28, 2020 · 1 comment

Comments

@rananaresh86
Copy link

rananaresh86 commented Dec 28, 2020

Hi There,

Is there any we can set different colors for different markers on the map?
I am using this way:

let markers = [];
mapData.data.map((dObj, di) => {
// console.log(dObj.name);
const dcMarkers = {};
const latVal = dObj.lat.toFixed(2);
const lngVal = dObj.long.toFixed(2);
const latLong = [latVal, lngVal];
dcMarkers['latLng'] = latLong;
dcMarkers['name'] = dObj.name;
dcMarkers['style'] = {
r: 5,
fill: 'grey',
stroke: '#505050',
"fill-opacity": 1,
"stroke-width": 1,
"stroke-opacity": 1,
};
// dcMarkers['markerStyle'] = {fill: 'red'};
// dcMarkers['selected'] = {fill: 'red'};
markers[di] = dcMarkers;
});

On the style object, the radius is working but the fill is not working.
Please help.

Thanks

@UditDubey210
Copy link

Hi @rananaresh86 , i want to set markers for all countries in my app, so can you share how to set it ??
Is it compulsory to give lat and lng, if yes then from where we will get the exact value??
Can't library have itself??

kadoshms pushed a commit that referenced this issue Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants