arcgis-map-ipywidget
Advanced tools
Comparing version 1.5.0-beta.25 to 1.5.0-beta.26
{ | ||
"name": "arcgis-map-ipywidget", | ||
"version": "1.5.0-beta.25", | ||
"version": "1.5.0-beta.26", | ||
"description": "The map widget for the ArcGIS API for Python", | ||
@@ -5,0 +5,0 @@ "author": "esri", |
@@ -53,3 +53,3 @@ //The main module that exports the javascript widget class | ||
_custom_msg: "", | ||
_hide_view_switch: false, | ||
hide_mode_switch: false, | ||
_trigger_interactive_draw_mode_for: "", | ||
@@ -56,0 +56,0 @@ _trigger_new_jlab_window_with_args: {}, |
@@ -97,3 +97,3 @@ //The main module that exports the javascript widget class | ||
this.model.on('change:_custom_msg', this.custom_msg_changed, this); | ||
this.model.on('change:_hide_view_switch', this.hide_view_switch_changed, this); | ||
this.model.on('change:hide_mode_switch', this.hide_mode_switch_changed, this); | ||
this.model.on('change:_trigger_interactive_draw_mode_for', this.interactive_draw_shape, this); | ||
@@ -126,3 +126,3 @@ this.model.on('change:_trigger_new_jlab_window_with_args', this.trigger_jlab_window_changed, this); | ||
//start miscellanous model section | ||
this.hide_view_switch_changed(); | ||
this.hide_mode_switch_changed(); | ||
this.portal_token_changed(); | ||
@@ -736,11 +736,8 @@ this.authenticate_to_portal().then((_) => { | ||
hide_view_switch_changed: function(){ | ||
hide_mode_switch_changed: function(){ | ||
//NOTE: it is only possible to remove this element | ||
//To 'recreate', you must instantiate a whole new object | ||
if(this.model.get("_hide_view_switch")){ | ||
console.log("Removing the view switch..."); | ||
var viewSwitch = document.getElementById(this.elements.switchButton.id) | ||
if(viewSwitch){ | ||
viewSwitch.remove(); | ||
} | ||
if(this.model.get("hide_mode_switch")){ | ||
console.log("Removing the mode switch..."); | ||
this.elements.switchButton.remove(); | ||
} | ||
@@ -747,0 +744,0 @@ }, |
@@ -17,4 +17,4 @@ var getEsriLoader = require("../loaders/get-esri-loader"); | ||
// {//typedLayer is an instance of type FeatureLayer }) | ||
//TODO: Remove logic for major layer types here (i.e., FeatureLayer) and | ||
//put them in their own JS file | ||
//TODO: put logic for major layer types here (i.e., FeatureLayer) in | ||
//their own JS file | ||
return new Promise(function(resolve, reject) { | ||
@@ -28,3 +28,4 @@ esriLoader.loadModules(['esri/layers/ImageryLayer', | ||
'esri/tasks/support/FeatureSet', | ||
'esri/PopupTemplate'], | ||
'esri/PopupTemplate', | ||
'esri/layers/support/RasterFunction'], | ||
options).then(([ImageryLayer, | ||
@@ -37,8 +38,22 @@ KMLLayer, | ||
FeatureSet, | ||
PopupTemplate]) => { | ||
PopupTemplate, | ||
RasterFunction]) => { | ||
if (noTypeLayer.type === "ImageryLayer"){ | ||
var copyNoTypeLayer = JSON.parse(JSON.stringify(noTypeLayer)); | ||
delete copyNoTypeLayer.type; | ||
var typedLayer = new ImageryLayer(copyNoTypeLayer); | ||
var typedLayer = new ImageryLayer(noTypeLayer.url); | ||
typedLayer.id = noTypeLayer._hashFromPython; | ||
if (('options' in noTypeLayer) && | ||
('imageServiceParameters' in noTypeLayer.options) && | ||
('renderingRule' in noTypeLayer.options.imageServiceParameters)){ | ||
//If a raster function is being passed as an arg | ||
console.log("Applying raster function to imagery layer.."); | ||
var renderingRule = | ||
noTypeLayer.options.imageServiceParameters.renderingRule; | ||
var rasterFunction = RasterFunction.fromJSON(renderingRule); | ||
// functionName: renderingRule.rasterFunction, | ||
// functionArguments: renderingRule.rasterFunctionArguments, | ||
// variableName: renderingRule. | ||
// }); | ||
typedLayer.renderingRule = rasterFunction; | ||
} | ||
resolve(typedLayer);} | ||
@@ -65,3 +80,4 @@ else if (noTypeLayer.type == "KMLLayer") { | ||
resolve(typedLayer);} | ||
else if ((noTypeLayer.type == "FeatureLayer") || (noTypeLayer.type == "Feature Layer")) { | ||
else if ((noTypeLayer.type == "FeatureLayer") || | ||
(noTypeLayer.type == "Feature Layer")) { | ||
//TODO: clean up this Feature layer stuff, seperate into new file | ||
@@ -68,0 +84,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
3180689
4652