angular-leaflet-directive
angular-leaflet-directive copied to clipboard
Attach a style to each feature of geojson
I've got a geojson file of US states. I want to generate a heatmap like visualization by painting each of these features differently. I've done it before (without angular) by implementing something like this: http://gis.stackexchange.com/questions/75590/setstyle-function-for-geojson-features-leaflet
However, when I try it with angular-leaflet like this,
geojson.style = {
fillColor: getStyle, // getStyle does not get called.
weight: 2,
opacity: 1,
color: 'black',
};
function getStyle(f){
console.log(f); //f is undefined
}
I'm confused on how to pass the feature to the function. The geojson feature in my case has properties like count which i use to pick appropriate color. Thanks.
+1
I ended up accessing the map object and changing it there. Let me know if y'all find a better alternative.
No solution ?