-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
I'm not sure if it is designed as this, but for me it is not convenient.
I added some Marker features to a FeatureGroup, as well added some Polylines to it. When I click Polylines, I can get latlng properties from the click event. But if I click any Marker, the click event object is different, there is no such properties.
This is code:
drawLayer.on('click', function(e){
var layer = e.layer;
var latlng;
if(layer && 'marker'==layer._$type){
latlng=layer.getLatLng(); // Click marker, e.latlng is undefined
}else if(layer && 'polyline'==layer._$type){
latlng=e.latlng; // Click polyline
}
});