Event behaviour is described in detail in the API reference documentation here: http://api.maps.nokia.com/en/apirefe...entTarget.html It explains that events will propagate through the DOM so the MapDisplay will also receive an event when the MapMarker is clicked. You can stop this by using methods such as stopImmediatePropagation() Consider this code snippet:
Code:
var map = new nokia.maps.map.Display(mapContainer, {
zoomLevel: 4, //zoom level for the map
center: [50.5,15.5], // center coordinates
components : [
new nokia.maps.map.component.ZoomBar(),
new nokia.maps.map.component.Behavior(),
new nokia.maps.map.component.TypeSelector(),
new nokia.maps.map.component.Overview(),
new nokia.maps.map.component.ScaleBar()]
});
map.addListener("click", function(evt) {
console.log(evt);
});
var marker = new nokia.maps.map.StandardMarker([50.5,15.5]);
marker.addListener("click", function(evt) {
console.log(evt);
evt.stopImmediatePropagation();
});
map.objects.add(marker);
Clicking on the marker will not fire the map "click" listener.