POST
|
Hi Maxime Demers, I have the same problem with mi Identify Tool and I solved it doing this: (Has API JavaScript 3.12, and works with AGS 10.5, you have to keep in mid that in previous versión of AGS, can't call original name of attributes) I'll put some aditional lines, on IdentifyParams, do that: var identifyParams = new esri.tasks.IdentifyParameters(); identifyParams.tolerance = this._tolerance; identifyParams.height = this.map.height; identifyParams.width = this.map.width; identifyParams.returnGeometry = true; identifyParams.returnFieldName = true; And this is the API JS with added text in bold from API Javascript called IdentifyParameters.js located in your API location. // All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.12/esri/copyright.txt for details. //>>built define("esri/tasks/IdentifyParameters", "dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../layerUtils ../geometry/jsonUtils ../geometry/scaleUtils".split(" "), function (g, e, h, f, n, p, k, q, r) { var d = g(null, { declaredClass: "esri.tasks.IdentifyParameters", constructor: function () { this.layerOption = d.LAYER_OPTION_TOP }, geometry: null, spatialReference: null, layerIds: null, tolerance: null, returnGeometry: !1, returnFieldName: !1, mapExtent: null, width: 400, height: 400, dpi: 96, layerDefinitions: null, timeExtent: null, layerTimeOptions: null, dynamicLayerInfos: null, toJson: function (b) { var c = b && b.geometry || this.geometry, a = this.mapExtent, d = this.spatialReference, e = this.layerIds; b = { tolerance: this.tolerance, returnGeometry: this.returnGeometry, returnFieldName:this.returnFieldName, imageDisplay: this.width + "," + this.height + "," + this.dpi, maxAllowableOffset: this.maxAllowableOffset }; if (c) { var l = c.toJson(); delete l.spatialReference; b.geometry = f.toJson(l); b.geometryType = q.getJsonType(c) } d ? b.sr = d.wkid || f.toJson(d.toJson()) : c && c.spatialReference ? b.sr = c.spatialReference.wkid || f.toJson(c.spatialReference.toJson()) : a && a.spatialReference && (b.sr = a.spatialReference.wkid || f.toJson(a.spatialReference.toJson())); a && (b.mapExtent = a.xmin + "," + a.ymin + "," + a.xmax + "," + a.ymax); b.layers = this.layerOption; e && (b.layers += ":" + e.join(",")); b.layerDefs = k._serializeLayerDefinitions(this.layerDefinitions); c = this.timeExtent; b.time = c ? c.toJson().join(",") : null; b.layerTimeOptions = k._serializeTimeOptions(this.layerTimeOptions); if (this.dynamicLayerInfos && 0 < this.dynamicLayerInfos.length) { var a = r.getScale({ extent: a, width: this.width, spatialReference: a.spatialReference }), g = k._getLayersForScale(a, this.dynamicLayerInfos), m = []; h.forEach(this.dynamicLayerInfos, function (b) { if (!b.subLayerIds) { var a = b.id; if ((!this.layerIds || this.layerIds && -1 !== h.indexOf(this.layerIds, a)) && -1 !== h.indexOf(g, a)) { var c = { id: a }; c.source = b.source && b.source.toJson(); var d; this.layerDefinitions && this.layerDefinitions && (d = this.layerDefinitions); d && (c.definitionExpression = d); var e; this.layerTimeOptions && this.layerTimeOptions && (e = this.layerTimeOptions); e && (c.layerTimeOptions = e.toJson()); m.push(c) } } }, this); a = f.toJson(m); "[]" === a && (a = "[{}]"); b.dynamicLayers = a } return b } }); e.mixin(d, { LAYER_OPTION_TOP: "top", LAYER_OPTION_VISIBLE: "visible", LAYER_OPTION_ALL: "all" }); n("extend-esri") && e.setObject("tasks.IdentifyParameters", d, p); return d }); Hope it helps 2u, my english is a little bad =). On the other hand, you can look at the link below to see oficial documentatión. IdentifyParameters | API Reference | ArcGIS API for JavaScript 3.25
... View more
09-07-2018
08:42 AM
|
2
|
0
|
564
|
POST
|
Hi, I'm not good with english but I hope to help you. I have the same problem, I'm working with API JS 3.12 and AGS 10.5, the problem was the same as the first of the list when I set the layer definition directly on a dynamic layer previously charged. So, in my case I solved it by modyfing the init.js, on the next method original method: setLayerDefinitions:function(b,c){this.layerDefinitions=b;this._params.layerDefs=a._serializeLayerDefinitions(b);this._updateDynamicLayers();c||this.refresh(!0)}, changed to new method: setLayerDefinitions:function(b,c){this.layerDefinitions=b;this._params.layerDefs="{"+a._serializeLayerDefinitions(b)+"}";this._updateDynamicLayers();c||this.refresh(!0)}; Whatever it solved my problem.
... View more
09-06-2018
01:17 PM
|
0
|
0
|
504
|
Title | Kudos | Posted |
---|---|---|
2 | 09-07-2018 08:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|