|
POST
|
If anyone is looking to create a multi-field UniqueValueRenderer via rendererJsonUtils.fromJSON or UniqueValueRenderer.fromJSON, the still undocumented JSON structure for specifying it with uniqueValueGroups has the corresponding structure below: {
"type": "uniqueValue",
"field1": "test1",
"field2": "test2",
"uniqueValueGroups": [{
"heading": "Heading 1",
"classes": [{
"label": "Label 1",
"symbol": {
"type": "esriSMS",
"style": "esriSMSCircle",
"color": [88,255,96,255],
"outline": {
"color": [140,255,120,128],
"width": 6
}
},
"values": [
["testValue","testValue2"],
["testValue1","testValue2"]
]
}, {
"label": "Label 2",
"symbol": {
"type": "esriSMS",
"style": "esriSMSCircle",
"color": [88,255,96,255],
"outline": {
"color": [140,255,120,128],
"width": 6
}
},
"values": [
["testValue3","testValue4"]
]
}]
}]
} Note that the "values" property must be specified as an Array of arrays.
... View more
08-31-2023
02:48 PM
|
0
|
2
|
2063
|
|
POST
|
Aside from a couple exceptions, the order in which layers are drawn is the same as the order in which layers are found in the Map.allLayers property. Changing the order of layers is made possible through the Map.reorder method, As for the exceptions, see the notes in the documentation for the allLayers property and the reorder method, both of which are hyperlinked above.
... View more
08-31-2023
10:14 AM
|
0
|
0
|
2374
|
|
POST
|
This looks like a scope issue. In your anonymous function called by setInterval, "this" will refer to the window, not the instance of the widget. You should be able to get around this using bind: window.setInterval(function() {
this.processing = !this.processing;
}.bind(this), 5000);
... View more
08-30-2023
03:31 PM
|
0
|
0
|
2218
|
|
POST
|
You can use bind to pass a reference to the layer into your handler: layer.on("edits", function(editLayer, result) {
alert(editLayer.id + " :: " + editLayer.title + " :: " + editLayer.type);
}.bind(this, layer));
... View more
08-29-2023
04:31 PM
|
1
|
0
|
1645
|
|
POST
|
That's a different problem in a different module, which I also fix in the local copy. My notes on it (specific to 4.27) are below: esri/views/draw/DrawGraphicTool.js Prevent empty polygon from following mouse cursor around when starting a sketch using the regular or freehand polygon drawing tools. Note that this issue doesn't apply to rectangles or circles. This behavior evidently started in 4.25. Search for: h._createOrUpdateGraphic=function(a){ Replace with: h._createOrUpdateGraphic=function(a){if((a)&&(a.type=="polygon")&&((a.rings.length===0)||(a.rings[0].length<3)))return;
... View more
08-28-2023
10:29 AM
|
0
|
0
|
3119
|
|
POST
|
I have a fix for that, but it involves modifying a file on a locally hosted copy of the SDK. That is, I download and host a copy of the SDK on our own servers rather than using ESRI's server at runtime. Here are my notes, which are specific to 4.27 (although may work in previous version as well): esri/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js Prevent vertex symbol from appearing with mouse cursor when using a freehand drawing tool. Note: this behavior started in 4.21. Search for: this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex); Replace with: if(this.get("drawOperation.drawingMode.updating"))this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex);
... View more
08-25-2023
04:00 PM
|
0
|
2
|
3145
|
|
POST
|
SketchViewModel extends Accessor, and therefore has the "set" method. More info here and here.
... View more
08-25-2023
12:59 PM
|
0
|
4
|
3153
|
|
POST
|
I think the problem here is that three different things are being considered as if they were the same, or at least closely related...however, they are quite distinct. 1) The visible property for a field on the Update Definition operation determines whether or not the field (and its data) is exposed to the service. If the value is set to false, then information for that field will not be returned in a request for service information, nor will it be included in a query response. To the end user, it will be as if the field doesn't exist at all. 2) The Field object within the SDK does not have a visible property, because it would have no meaning. As far as a layer at runtime within the SDK is concerned, either a field exists or it doesn't. It if exists, the information about it will be in the response sent by the server when the object requests information about the layer (e.g. as seen in the image you posted). Otherwise, no information is provided to the client about fields that, in essence, don't exist. 3) Whether or not a field and its information is visible in the Popup when you click on a feature is determined by how the layer's PopupTemplate is setup. Setting up a PopupTemplate is a very broad topic, but it gives you full control over what is displayed and what isn't. For example, the fieldInfos property allows you to specify information about the fields via FieldInfo objects. These FieldInfo objects have a visible property that would allow you to control whether the field is displayed or not.
... View more
08-23-2023
04:31 PM
|
0
|
0
|
2057
|
|
POST
|
Unfortunately the ScaleDependentRenderer was not migrated from 3x to 4x. In addition, unlike in 3.x, you cannot create custom renderer modules in 4.x applications. Therefore, you'll have to approach this differently in 4.x. Basically, a ScaleDependentRenderer was a collection of other renderers, one of which would become active at a given scale range. Therefore, in a 4.x application, you'll need to (1) create that collection of other renderers manually, (2) watch the scale of the view, and when it changes, (3) determine which renderer from the collection your layer should be using. There's also more information in this thread.
... View more
08-22-2023
10:27 AM
|
1
|
1
|
1610
|
|
POST
|
No, this is not a bug. It is by design that modules are not downloaded until they are imported via a call to "require" or "define". Therefore, it makes sense to import the modules you need when the application is starting up. It may make startup time a little bit longer, but the user expects some load time at the beginning.
... View more
08-22-2023
10:10 AM
|
1
|
0
|
1782
|
|
POST
|
The SketchViewModel has an undocumented property called "vertexSymbol" which, by default, it is set to a circular SimpleMarkerSymbol with a white background and a dark grey border. I would recommend setting the opacity of the symbol in order to show and hide it as desired: function hideVertexSymbol(sketchViewModel) {
sketchViewModel.set("vertexSymbol.outline.color.a", 0);
sketchViewModel.set("vertexSymbol.color.a", 0);
}
function showVertexSymbol(sketchViewModel) {
sketchViewModel.set("vertexSymbol.outline.color.a", 1);
sketchViewModel.set("vertexSymbol.color.a", 1);
}
... View more
08-21-2023
10:27 AM
|
1
|
6
|
3179
|
|
POST
|
If you're wanting to get the map coordinates of the bottom-right point, it would be better to calculate from the pre-existing "screenPoint" variable instead: var bottomrightX = screenPoint.x + 200 //200 is the width of the box pre css
var bottomrightY = screenPoint.y + 300 //300 is the height of the box per For consistency, you also might want to use the same coordinate system in your call to console.log: console.log("POINT = " + ptUpdate.longitude + "," + ptUpdate.latitude);
... View more
08-18-2023
04:16 PM
|
0
|
0
|
3334
|
|
POST
|
Yes, but what I'm saying is that you should also include Sketch and SketchViewModel in the call to require in function A, even if you don't use them in function A. That way, Sketch and SketchViewModel will already be available on the client by the time function B is called. Otherwise function B executes, and then it has to wait until those modules download before the "real" execution takes place.
... View more
08-18-2023
09:58 AM
|
0
|
2
|
1796
|
|
POST
|
The point declaration is invalid, and it also needs to be wrapped in view.when: view.when(function() {
var point = new Point({x:-121.755, y:38.359});
var screenPoint = view.toScreen(point);
var rect = view.container.getBoundingClientRect();
var left = screenPoint.x + rect.left + window.scrollX;
var top = screenPoint.y + rect.top + window.scrollY;
var box = document.getElementById("box");
box.style.position = "absolute";
box.style.left = left.toString() + "px";
box.style.top = top.toString() + "px";
});
... View more
08-17-2023
05:47 PM
|
0
|
2
|
3362
|
|
POST
|
This appears to work: var screenPoint = view.toScreen(point);
var rect = view.container.getBoundingClientRect();
var left = screenPoint.x + rect.left + window.scrollX;
var top = screenPoint.y + rect.top + window.scrollY;
var box = document.getElementById("box");
box.style.position = "absolute";
box.style.left = left.toString() + "px";
box.style.top = top.toString() + "px";
... View more
08-17-2023
04:16 PM
|
0
|
4
|
3379
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-19-2024 10:37 AM | |
| 1 | 03-31-2026 02:34 PM | |
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM |