arcgis-map-ipywidget
Advanced tools
Comparing version 1.5.0-beta.26 to 1.5.0
{ | ||
"name": "arcgis-map-ipywidget", | ||
"version": "1.5.0-beta.26", | ||
"version": "1.5.0", | ||
"description": "The map widget for the ArcGIS API for Python", | ||
@@ -5,0 +5,0 @@ "author": "esri", |
@@ -28,3 +28,5 @@ //The main module that exports the javascript widget class | ||
_extent: {}, | ||
_readonly_extent: {}, | ||
_center: {}, | ||
_readonly_center: {}, | ||
_center_long_lat: [], | ||
@@ -31,0 +33,0 @@ //end map specific draw state |
@@ -104,4 +104,5 @@ //The main module that exports the javascript widget class | ||
//Last thing to do: update the widget state from the model's | ||
this.update_widget_from_model(); | ||
this._postLoadSetup(); | ||
this.update_widget_from_model().then(() => { | ||
this._postLoadSetup(); | ||
}); | ||
}).catch((err) => { | ||
@@ -114,31 +115,35 @@ this._displayErrorBox(); | ||
update_widget_from_model: function(){ | ||
//start map specific draw state | ||
this.mode_changed(); | ||
this.basemap_changed(); | ||
this.zoom_changed(); | ||
this.rotation_changed(); | ||
this.heading_changed(); | ||
this.tilt_changed(); | ||
this.center_long_lat_changed(); | ||
this.center_changed(); | ||
this.extent_changed(); | ||
//end map specific draw state | ||
//start miscellanous model section | ||
this.hide_mode_switch_changed(); | ||
this.portal_token_changed(); | ||
this.authenticate_to_portal().then((_) => { | ||
//Authenticate to the portal before attempting to load anything | ||
//end miscellanous model section | ||
//start layer specific model calls | ||
this.draw_these_notype_layers_on_widget_load(); | ||
this.draw_these_graphics_on_widget_load(); | ||
//end layer specific model calls | ||
//start webmap/webscene section | ||
this.webmap_changed(); | ||
this.webscene_changed(); | ||
//end webmap/webscene section | ||
}).catch((err) => { | ||
this._displayErrorBox("Error while authenticating to portal on first load."); | ||
console.warn("Error during portal auth"); console.warn(err); | ||
}); | ||
return new Promise((resolve, reject) => { | ||
//start map specific draw state | ||
this.mode_changed(); | ||
this.basemap_changed(); | ||
this.zoom_changed(); | ||
this.rotation_changed(); | ||
this.heading_changed(); | ||
this.tilt_changed(); | ||
this.center_long_lat_changed(); | ||
this.center_changed(); | ||
this.extent_changed(); | ||
//end map specific draw state | ||
//start miscellanous model section | ||
this.hide_mode_switch_changed(); | ||
this.portal_token_changed(); | ||
this.authenticate_to_portal().then((_) => { | ||
//Authenticate to the portal before attempting to load anything | ||
//end miscellanous model section | ||
//start layer specific model calls | ||
this.draw_these_notype_layers_on_widget_load(); | ||
this.draw_these_graphics_on_widget_load(); | ||
//end layer specific model calls | ||
//start webmap/webscene section | ||
this.webmap_changed(); | ||
this.webscene_changed(); | ||
//end webmap/webscene section | ||
resolve(); | ||
}).catch((err) => { | ||
this._displayErrorBox("Error while authenticating to portal on first load."); | ||
console.warn("Error during portal auth"); console.warn(err); | ||
reject(err); | ||
}); | ||
}) | ||
}, | ||
@@ -275,3 +280,3 @@ | ||
if(center){ | ||
widget_inst.model.set("_center", JSON.parse(JSON.stringify(center))) | ||
widget_inst.model.set("_readonly_center", JSON.parse(JSON.stringify(center))) | ||
} | ||
@@ -281,3 +286,3 @@ | ||
if(extent){ | ||
widget_inst.model.set("_extent", JSON.parse(JSON.stringify(extent))); | ||
widget_inst.model.set("_readonly_extent", JSON.parse(JSON.stringify(extent))); | ||
} | ||
@@ -304,3 +309,6 @@ widget_inst.model.save_changes(); | ||
this.model.set('ready', true) | ||
this.model.save_changes()}); | ||
this.model.set('_readonly_extent', this._2dMap.extent); | ||
this.model.set('_readonly_center', this._2dMap.center); | ||
this.model.save_changes(); | ||
}); | ||
@@ -310,3 +318,6 @@ this._3dMap.when(() => { | ||
this.model.set('ready', true) | ||
this.model.save_changes()}); | ||
this.model.set('_readonly_extent', this._3dMap.extent); | ||
this.model.set('_readonly_center', this._3dMap.center); | ||
this.model.save_changes(); | ||
}); | ||
@@ -321,3 +332,2 @@ //Whenever you click on the map, send an event for python to listen to | ||
}); | ||
@@ -708,12 +718,25 @@ }, | ||
add_notype_layer: function(noTypeLayer){ | ||
inferNoTypeLayer(noTypeLayer, this).then((typedLayer) => { | ||
var layerExistsOnMap = Boolean(this.map.findLayerById( | ||
typedLayer.id)); | ||
console.log("Adding Layer " + noTypeLayer._hashFromPython + " " + | ||
"to map."); | ||
this.map.add(typedLayer); | ||
}).catch((err) => { | ||
this._displayErrorBox("Could not update layer. " + err); | ||
console.warn("Could not update layer"); console.warn(err); | ||
var layersToInfer = []; | ||
if (noTypeLayer.layers){ | ||
for(var i = 0; i < noTypeLayer.layers.length; i++){ | ||
var layer = noTypeLayer.layers[i]; | ||
layer.options = noTypeLayer.options; | ||
layersToInfer.push(layer); | ||
} | ||
} else { | ||
layersToInfer.push(noTypeLayer); | ||
} | ||
for(var i = 0; i<layersToInfer.length; i++){ | ||
var layerToInfer = layersToInfer[i]; | ||
inferNoTypeLayer(layerToInfer, this).then((typedLayer) => { | ||
var layerExistsOnMap = Boolean(this.map.findLayerById( | ||
typedLayer.id)); | ||
console.log("Adding Layer " + noTypeLayer._hashFromPython + " " + | ||
"to map."); | ||
this.map.add(typedLayer); | ||
}).catch((err) => { | ||
this._displayErrorBox("Could not update layer. " + err); | ||
console.warn("Could not update layer"); console.warn(err); | ||
}); | ||
} | ||
}, | ||
@@ -720,0 +743,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3188494
4683
2
48