Closed lavahot closed 9 years ago
My answer to issue 1026 should be what you're looking for.
Can you set it to anything other than off?
Using the config setting, you can only turn it to on or off. However, you can control which events get emitted, and thus logged, using the event-broadcast
attribute.
For example, if you set event-broadcast="events"
, then the following would log only the three events in the enable
array:
$scope.events = {
map: {
enable: ['click', 'load', 'zoomstart'],
logic: 'broadcast'
}
};
See the leafletMapEvents.js for the full list of possible events.
Thanks @srthurman!
I can't get the suggestion by @srthurman to work.
$scope.map = {
events: {
map: {
enable: [],
logic: 'emit'
},
marker: {
enable: ['click'],
logic: 'emit'
}
},
defaults: {
tileLayerOptions: {
detectRetina: true,
reuseTiles: true
}
},
center: {
lat: 42.35321607653588,
lng: -71.05476379394531,
zoom: 12
}
};
<leaflet center="map.center" defaults="map.defaults" event-broadcast="map.events" markers="map.markers"></leaflet>
All events for both map and marker are logged in the console. I would expect that only marker click events are logged.
markers: { enable: ['click'], logic: 'emit' }
changing marker into markers worked for me @esetnik
I've been trying to find out how to set the level of logging that I want to do, as it's fairly annoying to get spammed with hundreds of map events in the console while I'm debugging. Is there some way to limit (or turn off) logging?