-
Notifications
You must be signed in to change notification settings - Fork 654
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
Insert custom marker icons in a leaflet map #301
Comments
Here is how you can do it now. Unfortunately, it is a little messy as there is no mechanism currently to define a separate icon variable and then use it. L1$geoJson(toGeoJSON(data_),
pointToLayer = "#! function(feature, latlng){
return L.marker(latlng, {icon: L.Icon.extend({
options: {
shadowUrl: 'leaf-shadow.png',
iconSize: [38, 95],
shadowSize: [50, 64],
iconAnchor: [22, 94],
shadowAnchor: [4, 62],
popupAnchor: [-3, -76]
}})
})
} !#"
) |
Thanks! |
Hi Ramnathv, And how would it be for two type of icons?, I have two data frames with the coordinates points i want to add, each represent different items, so i want to place different markers, at least about color. Should be something like this? (i'm affraid that no, because i'm not sure that calling twice to $geoJson it'd append both set of points to the map) set markers type 1L1$geoJson(toGeoJSON(df1), set markers type 2L1$geoJson(toGeoJSON(df2), |
Any help with multiple icons? The code above does not work for me. $geoJson does not append the new icons, but overwrites the old ones. |
Sorry, I've never managed :-( |
Hey @ramnathv - Curious how to use custom icons in a leaflet map. I think I got it except for I don't know where to define the new icon:
Which I can then use e.g., by
Where can I define in a new icon var?
The text was updated successfully, but these errors were encountered: