missioncommand / emp3-web

Extensible Map Platform (EMP) web development kit
Other
18 stars 9 forks source link

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

Open sjpinizzotto opened 7 years ago

sjpinizzotto commented 7 years ago

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}
        );
      }
    });
  }
});
jaybarra commented 7 years ago

@sjpinizzotto I cannot replicate this in Cesium, WorldWind and Leaflet seem to be having issues however.

erikamarie commented 7 years ago

Could not replicate issue in Cesium or Worldwind. Leaflet is still having issues.

erikamarie commented 7 years ago

@nclark25 Leaflet is throwing error in "mergeGeoJSONProperties" function of leaflet-eng.utils.geoJson.js on JSON that Cesium and Worldwind handle just fine.

"message":"this.options is undefined", "file":"http://localhost:3000/src/mapengine/leaflet/js/utils/leaflet-eng.utils.geoJson.js", "line":227, "column":21,