Edit this page

shapeFeatureCreated

Fired when a GeoJSON Feature is created on a shape layer.

Event Data

e.dataItem Object

The original data item for this Feature. Members include geometries and properties.

e.layer kendo.dataviz.map.layer.Shape

The parent layer instance.

e.group kendo.drawing.Group

The group containing feature shape instances.

e.properties Object

A reference to the dataItem.properties object.

e.sender kendo.dataviz.ui.Map

The source widget instance.

Example - bind to the map shapeFeatureCreated event on initialization

<div id="map"></div>
<script>
  var data = [
    { "type": "Feature",
     "geometry": {
       "type": "Polygon",
       "coordinates": [
         [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
          [100.0, 1.0], [100.0, 0.0] ]
       ]
     },
     "properties": {
       "name": "Feature #1"
     }
    }
  ];

  $("#map").kendoMap({
    center: [0.5, 100.5],
    zoom: 8,
    layers: [{
      type: "shape",
      dataSource: {
        type: "geojson",
        data: data
      }
    }],
    shapeFeatureCreated: onShapeFeatureCreated
  });

  function onShapeFeatureCreated(e) {
    console.log("feature created: ", e.properties.name);
  }
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy