POST
|
Robert, I thought my question was related to the original question and that's why I posted here. After many tries, I accidently found the tricky way to make it look the way I want: In HTML file, I added a space character to reserve a #text node in the outside contentpane: <div id="tableDiv" data-dojo-type="dijit/layout/ContentPane" region="bottom" splitter="true" style="overflow: hide"> </div> Then I programmably change the #text node value to layer name. Then it as the way I want. I didn't know this is the best answer so I didn't post it. Thanks
... View more
01-17-2019
10:37 AM
|
0
|
0
|
680
|
POST
|
Robert, I'm out of idea with my problem. I had grid nicely displayed with outside contentpane not set to "overflow: hidden" originally. My grid needs the scrollbars to get to all the data: Then after I set outside contentpane's innerHTML to the layer name, scrollbar for the contentpane shows up. The grid is pushed down a little bit too: If I set contentpane in HTML file style="overflow:hidden"(setting overflow="hidden" has not effect). That's what I got this: I can't not to scroll to all the data now. I also tried to add another contentpane above the grid to display layername etc, but the grid won't displayed as nice as the orignal way. Thanks ahead! Sandy
... View more
01-11-2019
05:22 PM
|
0
|
1
|
680
|
POST
|
Thank you so much! It works now. I would probably try bunch of other things before even thinking about there is difference between these two.
... View more
12-10-2018
12:29 PM
|
0
|
0
|
1617
|
POST
|
Robert, Thanks for your advice. I tried your suggestion of "this.map.centerAt(zoomExtent).then(lang.hitch(this, DoFlash()));" Then I tried "map.centerAt(zoomExtent).then(lang.hitch(this, DoFlash()));" I still got the same error message. Basically, I need to make sure DoFlash() happens after the map is re-centered. But when I put "alert" at the beginning of DoFlash(), the map exent has not changed yet.
... View more
12-10-2018
11:45 AM
|
0
|
2
|
1617
|
POST
|
Robert, I tried to add a flash point marker graphic in both ways when !this.map.extent.contains(zoomExtent): 1. this.map.centerAt(zoomExtent).then(DoFlash()); 2. new Promise(function(resolve, reject) { this.map.centerAt(zoomExtent); }).then(DoFlash()); I got error message 'Uncaught lang.hitch: scope["setStroke"] is null (scope="[object Window]")'. But no problem DoFlash() if the map doesn't need to be re-centered. Please help, thanks!
... View more
12-06-2018
03:28 PM
|
0
|
4
|
1617
|
POST
|
Well, I tried to add a flash point marker graphic in both ways when !this.map.extent.contains(zoomExtent): 1. this.map.centerAt(zoomExtent).then(DoFlash()); 2. new Promise(function(resolve, reject) { this.map.centerAt(zoomExtent); }).then(DoFlash()); I got error message 'Uncaught lang.hitch: scope["setStroke"] is null (scope="[object Window]")'. But no problem DoFlash() if the map doesn't need to be re-centered. Please help. Thanks!
... View more
12-06-2018
03:21 PM
|
0
|
0
|
1617
|
POST
|
Robert, I was not a javascript programmer at the beginning and with all other stuff added, I just tried to learn and compose my application from all the examples that I can find. Sorry for bothering you with these kind of amateur mistakes. What you pointed out makes sense. So I went on deleting 2 line codes: "identifyListener = map.on("click", executeIdentifyTask);" and "identifyListener.remove();" But still got extra unknown graphic. I had to create a new graphicslayer eventually as you suggested and that solved problem! Replacing "map.graphics" with "map.graphics.graphics" also answered my Question 2. Thanks a lot for taking time on my problems!
... View more
09-21-2018
05:59 PM
|
0
|
0
|
670
|
POST
|
Sounds promising! I'll try your suggestion after I figured out the first question. Thank you Robert! My identify tool is set to identify multiple visible layers. But only when it identifies polygon layer, the select with polygon feature button will do its thing. Layer: layerURL = "http://vs-pd-gis1:6080/arcgis/rest/services/TestMap5/MapServer"; crimeLayer = new ArcGISDynamicMapServiceLayer(layerURL, { id: 'crimelyrs' }); crimeLayer.setDisableClientCaching(true); My codes for identify: domConstruct.create("div", { id: "identify", title: "Identify Features By Drawing Rectangle"}, "mapDiv"); var btn = domConstruct.create("button", { value: "true", type: "button", id: "identifyBtn" }); domConstruct.place(btn, "identify"); var identifyTask, identifyParams; this.map.on("load", mapReady()); function mapReady() { on(dom.byId("identifyBtn"), "dblclick", function (evt) { buttonReady(); }); on(dom.byId("identifyBtn"), "click", function (evt) { buttonReady(); }); function buttonReady() { document.getElementById("identifyBtn").value = (document.getElementById("identifyBtn").value == "true" ? "false" : "true"); if (document.getElementById("identifyBtn").value == "false") { document.getElementById("identifyBtn").style.border = "thin solid rgba(81, 203, 238, 1)"; identifyListener = map.on("click", executeIdentifyTask); map.graphics.clear(); console.log(map.graphics); toolbar.activate(Draw.EXTENT); } else { document.getElementById("identifyBtn").style.border = "initial"; identifyListener.remove(); toolbar.deactivate(); //map.graphics.clear(); map.infoWindow.hide(); } }; //create identify tasks and setup parameters identifyTask = new IdentifyTask(layerURL); identifyParams = new IdentifyParameters(); identifyParams.tolerance = 3; identifyParams.returnGeometry = true; identifyParams.layerIds = [0, 1]; identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE; identifyParams.width = map.width; identifyParams.height = map.height; toolbar = new Draw(map); toolbar.on("draw-end", addToMap); } var marker = new SimpleMarkerSymbol(); marker.setStyle(SimpleMarkerSymbol.STYLE_SOLID); marker.setSize(6); marker.setColor(new Color([0, 255, 255, 0.6])); marker.setOutline(null); marker.setOffset(0, 0); var ln = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 255, 255]), 2); var poly = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 255, 255]), 2), new Color([0, 0, 0, 0])); function addToMap(evt) { identifyParams.geometry = evt.geometry; executeIdentifyTask(); console.log(map.graphics); } function executeIdentifyTask(event) { identifyParams.mapExtent = map.extent; var deferred = identifyTask.execute(identifyParams).addCallback(function (response) { //Sandy - set select by polygon button value var i = 0; return array.map(response, function (result) { var feature = result.feature; var layerName = result.layerName; if (result) { feature.setInfoTemplate(new InfoTemplate(layerName, "${*}")); if (feature.geometry.type == "point") { feature.setSymbol(marker); document.getElementById("QFBtn").value = "false"; } else if (feature.geometry.type == "line") { feature.setSymbol(ln); document.getElementById("QFBtn").value = "false"; } else if (feature.geometry.type == "polygon") { feature.setSymbol(poly); if (i == 0) { document.getElementById("QFBtn").value = "true"; } }; map.graphics.add(feature); i++; }; return feature; }); }); map.infoWindow.setFeatures([deferred]); map.infoWindow.setFeatures(map.graphics); map.infoWindow.show(identifyParams.geometry.getCenter()); }
... View more
09-19-2018
01:23 PM
|
0
|
2
|
670
|
POST
|
Thanks for taking time on this. Regarding Question 1: Before using IdentifyTask, "console.log(map.graphics);" shew: graphics:Array(0) length:0 __proto__:Array(0) hasAttributionData:false id:"mapDiv_graphics" infoTemplate:undefined Afterwards, "console.log(map.graphics);" shew: graphics:Array(2) 0: attributes:{OBJECTID: "3", AREANO: "NORTHWEST", DISTRICT: "NW", AREA: "823429570.678", LEN: "502834.824812", …} geometry:{rings: Array(12), _ring: 0, spatialReference: {…}, cache: {…}} infoTemplate:{title: "PDSDE.PDBOUND2017_CITYLIM", content: "${*}"} symbol:{style: "solid", outline: {…}, color: b.Color} _extent:{xmin: -13350849.073860977, ymin: 4406328.614823886, xmax: -13334876.6976592, ymax: 4421855.472176674, spatialReference: {…}, …} _graphicsLayer:{_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …} _layer:{_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …} _offsets:[0] _shape:{rawNode: path, shape: {…}, matrix: null, fillStyle: b.Color, strokeStyle: {…}, …} _suspended:false __proto__:Object 1: attributes:undefined geometry:{rings: Array(12), _ring: 0, spatialReference: {…}, cache: {…}} infoTemplate:undefined symbol:{style: "none", outline: {…}, color: b.Color} visible:false _bgShape:null _dataAttrs:{data-popup-highlight: "", data-hidden: ""} _extent:{xmin: -13350849.073860977, ymin: 4406328.614823886, xmax: -13334876.6976592, ymax: 4421855.472176674, spatialReference: {…}, …} _geomVersion:3 _graphicsLayer:{_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …} _layer:{_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …} _offsets:[0] _shape:{rawNode: path, shape: {…}, matrix: null, fillStyle: null, strokeStyle: {…}, …} _suspended:false __proto__:Object length:2 __proto__:Array(0) hasAttributionData:false id:"mapDiv_graphics" infoTemplate:undefined Regarding Question 2, before "var geometries = graphicsUtils.getGeometries(map.graphics);", "console.log(map.graphics);" shew same 2 graphics above: graphics:(2) [{…}, {…}] Afterwards, "console.log(map.graphics);" shew same 2 graphics above, but "console.log(geometries);" shew: []length: 0__proto__: Array(0) Also, there's a tip says this empty array "value below was evaluated just now." when "Error: Unable to perform buffer" is logged. I saw in API reference, there's the sample: require([ "esri/graphicsUtils", ... ], function(graphicsUtils, ... ) { geometries[0] = graphicsUtils.getGeometries(baseGraphics); ... }); But I can't find any explanation on what "baseGraphics" are. Also, I couldn't understand why "geometries[0]" is in place of a supposed array here. I couldn't duplicate this practice, either. I thought this "baseGraphics" might have something to do with the extra graphic I got, which could be a default graphic added automatically to the map's graphiclayer?
... View more
09-19-2018
10:16 AM
|
0
|
4
|
670
|
POST
|
I'm trying to let user select polygons in a dynamiclayer with identifyTask. Then use selected pplygons as geometryservice buffer tool buffer. Question 1: After added identified result polygons to map.graphics, there always one extra unknow graphic than identified? Question 2: var geometries = graphicsUtils.getGeometries(map.graphics) returns empty geometries while map.graphics are not empty? Thanks for any help, Tong Sun
... View more
09-18-2018
03:33 PM
|
0
|
8
|
847
|
POST
|
Hi, I need to customize zoom slider to zoom in like how toolbar navigation zoom in button works. But all the links above don't go anywhere anymore. Can you update the links or give some codes to just demo how it's done? Thanks
... View more
07-31-2018
01:38 PM
|
0
|
0
|
395
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|