User Manual

Transforming Layers

The Layer Object provides a number of methods for filtering layer data namely:

NOTE: Because the Layer Object implements method chaining, multiple filters can be applied to a layer.

JavaScript


window.onload = function () {
    var map = new Mapzania.Map("map-div", "AFRICA", function () {
	    map.usingLayer("COUNTRIES")
	        .clearFilters()
	        .filterByNearest(point, {take: 5})
	        .bufferGeometry(1.5)
	        .convertToCentroids()
	        .update();
};

The following interactive examples show this in action: