-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle the case where a layer is added and re-added and destroying co…
…ntrols when necessary var myLayer; function _setupSampleLayer(args) { var layer = args.layer; var target = args.target; layer.setVisibility(true); layer.opacity = 1; for (var i = 0; i < 8; i++) { var eLayerInfo = layer.layerInfos[i]; eLayerInfo.defaultVisibility = true } }; function _loadSampleLayer() { var imageParameters = new esri.layers.ImageParameters(); imageParameters.layerIds = [0,1,2,3,4,5,6,7]; imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; myLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://hougissrv02:6080/arcgis/rest/services/Integrations_iApps/DEN_iAppsBase/MapServer", {id: "MyMapService", visible : true, imageParameters : imageParameters } ); myLayer.on("load", function(args) { _setupSampleLayer(args); }); myLayer.on("error", function(args) { debugger; }); this.app.map.addLayer(myLayer); this.app.map.on("layer-add-result", function(args) { var layer = args.layer; var error = args.error; var layerInfo = { title : "My Sample Title", type : "dynamic", layer : layer } dojo.publish('layerControl/addLayerControls', [[layerInfo]]); }); } dojo.publish("layerControl/removeLayerControls", [[myLayer]])
- Loading branch information
1 parent
cdf2533
commit f1fa53c
Showing
4 changed files
with
62 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters