Skip to content

Commit

Permalink
Bug fix for Dynamic services containing a single layer, updated manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ashina-creator committed Nov 17, 2015
1 parent 2d3438e commit e7fe3d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LocalLayerWidget 1.2.1
LocalLayerWidget 1.2.2
==

The LocalLayer Widget for ArcGIS Web AppBuilder is intended to allow the direct addition of ArcGIS for Server MapServices to an ArcGIS Web AppBuilder application, without needing to wrap the desired services in an ArcGIS Online/Portal Web Map. The Legend, LayerList, and AttributeTable widgets should continue to work with your Local Layers.
Expand Down
6 changes: 4 additions & 2 deletions Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ define([
lOptions.id = layer.name;
}
if(layer.hasOwnProperty('hidelayers')){
lOptions.hidelayers = []
lOptions.hidelayers = layer.hidelayers.split(',');
if (layer.hidelayers){
lOptions.hidelayers = []
lOptions.hidelayers = layer.hidelayers.split(',');
}
}
if(layer.hasOwnProperty('minScale')){
lOptions.minScale = layer.minScale
Expand Down
5 changes: 2 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "LocalLayer",
"label": "Local Layer Widget",
"platform": "HTML",
"version": "1.2",
"version": "1.2.2",
"wabVersion": "1.3",
"author": "Adam Drackley (adam.drackley@gmail.com) & Robert Scheitlin",
"description": "This widget is for adding local layers to Web AppBuilder",
Expand All @@ -12,7 +12,6 @@
"inPanel": false,
"hasConfig": true,
"hasStyle": false,
"hasUIFile": false,
"supportMultiInstance": false
"hasUIFile": false
}
}
12 changes: 9 additions & 3 deletions setting/DynamicLayerEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ define(
var hiddenLayer;
var isVisible = args.config.defaultVisibility;
if(this.config.hasOwnProperty('hidelayers')){
hiddenLayer = this.config.hidelayers.split(',');
if (this.config.hidelayers){
hiddenLayer = this.config.hidelayers.split(',');
}else{
hiddenLayer = [];
}
if(array.indexOf(hiddenLayer, args.config.id) >= 0){
isVisible = false;
//isVisible = true;
Expand Down Expand Up @@ -230,11 +234,13 @@ define(

var visibleLayers = [];
array.map(rowsData, lang.hitch(this, function (item) {
if (item.layerindex == ""){item.layerindex = "0"}
if(!item.visible){
if (item.layerindex == ""){item.layerindex = "0"}
visibleLayers.push(parseInt(item.layerindex))
}
}));
var _hideLayers = visibleLayers.join();
if (_hideLayers == ""){_hideLayers = null};
var dynamiclayer = {
type: 'Dynamic',
name: this.layerTitle.get('value'),
Expand All @@ -248,7 +254,7 @@ define(
minScale: this.minScale.get('value'),
maxScale: this.maxScale.get('value'),
//hidelayers: allHiddenLayers.join()
hidelayers: visibleLayers.join()
hidelayers: _hideLayers
};
return [dynamiclayer, this.tr];
},
Expand Down

0 comments on commit e7fe3d1

Please sign in to comment.