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

addFeatureCollection

Adds a feature collection to the layer.

Parameters

Name Required Description
featureCollection Yes A GeoJSON FeatureCollection to be added to the layer.

Example

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

var features = {
    type: "FeatureCollection",
    features: [{
      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")
  .addFeatureCollection(features)
  .update();