POST
|
I am using LayerList widget which I am filling on layer-add even of the map. The layers are generated from the geoprocessing service based on the user interaction (so the number of layers varies). Every time a new layer is added I am building the LayerList. I would like to be able to zoom to each layer so I decided to use the button which can be added to each layer on the LayerList. I have problem with linking the onclick event of each button to my zoom function. I have tried different approaches (using dojo.connect, dojo.on, dojo.registry) – but none of them works. I do not quite yet understand the difference between them yet. What is strange is that when using for example dojo.connect line the zoom function is fired once (I assume during loading of the layer) but without clicking the button (!). Why? Can anyone please help and point me to the right solution – I have found only one example on the internet using the dojo.registry and dojo.ready function but that is assuming fixed number of layers. I have tried it too and I found that the dojo.ready function is fired before map layer-add event (WHY?) so it is of no use because the button does not exist yet. I am pasting part of the code related to the explained issue only. var map = new Map("mapDiv", { }); var layerList = new LayerList({ map: map, showLegend: true, showSubLayers: true, showOpacitySlider: true, layers: [] }, "layersDiv"); //ready(function () { // registry.byId("baseLayer").on("click", function () { // alert(); // }); //}); map.on("layer-add", function () { var tempLayers = []; for (var i = 0; i < map.layerIds.length; i++) { var btnZoom = domConstruct.create("button", { type: "button", id: map.layerIds, innerHTML: "Zoom" }, "divZoomButtons"); //dojo.connect(btnZoom, "onclick", ZoomToLayerID(map.layerIds)); //on(btnZoom, "onclick", ZoomToLayerID(map.layerIds)); tempLayers.push( { layer: map.getLayer(map.layerIds), button: btnZoom }); } layerList.layers = tempLayers; //layerList.refresh(); layerList.startup(); }) //layerList.on('load', function () { // var a = dojo.byId("baselayer"); // on(a, "onclick", ZoomToLayerID("baseLayer")); // //dojo.connect(a, "onclick", ZoomToLayerID(a.id)); //}) function ZoomToLayerID(layerID) { var ext = map.getLayer(layerID).fullExtent; map.setExtent(ext); } var baseLayer = new esri.layers.ArcGISDynamicMapServiceLayer("<link to the service – removed by me>", { id: "baseLayer", opacity: 0.5 }); baseLayer.name = "Base map"; map.addLayer(baseLayer); HTML part: <div id="mapDiv"></div> <div id="layersDiv"></div> <div id="divZoomButtons"></div>
... View more
11-22-2016
09:43 PM
|
0
|
1
|
2090
|
POST
|
Thank you for suggestions but I was not able to create overviews. I got error 999999. Unexpectedly I met Mr Pittman and we discussed this issue. He suggested to check the statistics and he was right. The solution in this case was to recalculate statistics even though they should be calculated, from advanced option, during adding data to mosaic dataset. It is worth to mention that it must be done from arc toolbox because when I was trying to build statistics in raster properties it looked as created but was not applied.
... View more
12-11-2012
12:29 AM
|
0
|
0
|
1422
|
POST
|
How to add grid or FGDBR�??s format rasters to mosaic dataset? I was trying different options but I am getting always gray image. (ArcGIS 10) Could anyone give me a hint how to make it? I need time-enabled rasters. Is there any other way to get it? Any help is appreciated.
... View more
12-06-2012
12:02 AM
|
0
|
2
|
3299
|
POST
|
Hi, I have been using spline command in Model Builder 9.3 to create surface with custom symbology and labels. The labels are not generated after upgrading to ArcGIS 10. To get them I have to press properties of the raster, then following message appears (The Classified renderer requires the data to have a histogram. Do you want to compute the histogram?) and after accepting the labels appear. Another 2 commands (???create raster layer??? and ???apply symbology from layer???) behave in the same way (layers for symbology are not generated). Could you advice for any solution - how to apply custom symbology for raster in model builder? Can user change default symbology and labels for raster used in model builder ? Thakns.
... View more
07-04-2011
02:45 AM
|
0
|
0
|
2100
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|