JS API
Map Object
QueryEngine Object
Layer Object
Feature Object
Query Object
GeoJson Function Library (Experimental)

on

Adds an event listener to the Map object. The listener will fire every time the event occurs.

Parameters

Name Required Description
type Yes The type (name) of the event for which to listen.
fn Yes The function to run when the event is fired. This function will be passed an object containing the event results. The properties of this object will depend on the event that was fired.

Example

var map = new Mapzania.Map("map-div", "WORLD", function(){
    map.on("streets_layer_changed", function (data) {
        console.log(data);
    });

    map.usingLayer("STREETS)
        .filterByText("StreetType=='HIGHWAY'")
        .update();
});