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

addFeature

Adds a feature to the layer.

Parameters

Name Required Description
feature Yes A GeoJSON Feature to be added to the layer.

Example

var map = new Mapzania.Map("map-div", "AFRICA");

var feature = {
      type: "Feature",
      geometry: {
        type: "LineString",
        coordinates: [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]
      },
      properties: { streetName: "Markus Street", streetType: "mainroad" }
    };

map.usingNewLayer("MY_FEATURES")
  .addFeature(feature)
  .update();