emp3-web icon indicating copy to clipboard operation
emp3-web copied to clipboard

Cannot call methods on the Features returned in the onSuccess callback of Map.addFeature and Map.addFeatures.

Open sjpinizzotto opened this issue 8 years ago • 3 comments

Run this script:

var feature1 = new emp3.api.MilStdSymbol({
  geoId: 'myPath',
  name: 'myPath',
  positions: [
    {latitude: 40, longitude: 40},
    {latitude: 41, longitude: 41}
  ],
  symbolCode: 'GFGPGLB----K--X'
});

var overlay1 = new emp3.api.Overlay(
  {geoId: 'overlay1', name: 'overlay1'}
);

map0.addOverlay({
  overlay: overlay1,
  onSuccess: function() {
    overlay1.addFeatures({
      features: [feature1],
      onSuccess: function() {
        map0.editFeature(
          {feature: feature1}
        );
      }
    });
  }
});

sjpinizzotto avatar Feb 03 '17 15:02 sjpinizzotto