|
POST
|
Interesting, I didn't know that sketch would default to the map SR, but that makes sense I think. Just something to keep in mind when using geometry engine methods. I should be a good practice anyway since it does require all geometries to be the same spatial reference. You could use the webMercatorUtils module to help convert geographic and webMercator pretty easily. graphicsLayer.graphics.map(function (gra) {
if (gra.geometry.spatialReference.wkid === 4326) {
updatedGeometry.push(
webMercatorUtils.geographicToWebMercator(
gra.geometry.clone()
)
);
}
else {
updatedGeometry.push(gra.geometry.clone());
}
});
const joinedPolygon = geometryEngine.union(updatedGeometry); That should do it. https://codepen.io/odoe/pen/oNdPKNv?editors=0010
... View more
10-07-2022
07:15 AM
|
1
|
0
|
5342
|
|
POST
|
This is expected. You might see some oddities because you are using a class instance to new up a new class, which you don't have to do // don't need this
updatedGeometry.push(new Polygon(gra.geometry));
// can do this
updatedGeometry.push(gra.geometry);
// or this
updatedGeometry.push(gra.geometry.clone()); But you have two polygons that do not overlap. So when they union, it becomes a polygon with multiple rings. You don't need to iterate over the rings, the result of the geometryEngine union is a geometry, so you can use it directly. const joinedPolygon = geometryEngine.union(updatedGeometry);
graphicsLayer.removeAll();
let resultgraphic = new Graphic({
geometry: joinedPolygon,
symbol: mergeSymbol
});
graphicsLayer.add(resultgraphic); demo: https://codepen.io/odoe/pen/RwyYKxN?editors=0010 If you want the polygons to become a single polygon with a single ring, you can do something like convexHull const [result] = geometryEngine.convexHull(updatedGeometry, true);
graphicsLayer.removeAll();
let resultgraphic = new Graphic({
geometry: result,
symbol: mergeSymbol
});
graphicsLayer.add(resultgraphic); demo: https://codepen.io/odoe/pen/ZEoMLmj
... View more
10-06-2022
08:40 AM
|
1
|
5
|
5363
|
|
POST
|
I thought that would have worked, but doesn't look like it. You can clone the symbol though, modify the outline and replace it. https://codepen.io/odoe/pen/zYjjOPm?editors=0010 // something like this
view.on("click", async (e) => {
const { results } = await view.hitTest(e);
for (let result of results) {
if (result.type === "graphic") {
const sym = result.graphic.symbol.clone();
const idx = Math.floor(Math.random() * 10);
sym.outline && (sym.outline.color = colors[
Math.floor(Math.random() * 10)
]);
sym.color = colors[
Math.floor(Math.random() * 10)
];
result.graphic.symbol = sym;
}
}
});
... View more
09-30-2022
04:36 PM
|
0
|
2
|
1691
|
|
POST
|
The interceptors only work when using the request method of the JSAPI. https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html It uses fetch under the hood, but can't intercept native fetch requests.
... View more
09-29-2022
10:58 AM
|
2
|
1
|
3381
|
|
POST
|
Not sure. Do you have a codepen or github showing the issue? Using your code here with some values and seems to work, could be something else. https://codepen.io/odoe/pen/wvjyxvj?editors=1000
... View more
09-28-2022
03:15 PM
|
0
|
0
|
2787
|
|
POST
|
@RiccardoKlinger you're very close. You just need to adjust your handler declaration and how you handle it a bit. https://codepen.io/odoe/pen/bGMaJPW?editors=1001 let handler;
function myChange() {
if (document.getElementById("check").checked) {
// check if null
if (handler) {
return;
}
handler = view.on("click", (event) => {
const point = `point: (${event.mapPoint.latitude}, ${event.mapPoint.longitude})`;
console.log(point);
});
} else {
// remove and set to null
handler?.remove();
handler = null;
}
}
... View more
09-27-2022
01:36 PM
|
0
|
0
|
5278
|
|
POST
|
The ".on()" methods in the API return a Handler with a remove method you can use to remove the listener. let handler;
handler = view.on("click", () => {
console.log("click");
handler && handler.remove();
}); Looks like something happened to the doc on this. I'll pass it on, thanks! Looks like it's not a specific type, it's just an Object with a remove() method as described here. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#on
... View more
09-27-2022
11:10 AM
|
0
|
2
|
5310
|
|
POST
|
If you have a sample repro in codepen or github, would be helpful to track down the issue. This sample works as expected when the popup closes via view.popup.close() https://codepen.io/odoe/pen/LYmOwvY?editors=100
... View more
09-26-2022
08:27 AM
|
0
|
0
|
1702
|
|
POST
|
Not sure I understand the context. Calcite Components is a UI component library, it doesn't have any specific connection to arcgis services. The Editor widget uses Calcite Components.
... View more
09-23-2022
10:35 AM
|
0
|
0
|
848
|
|
POST
|
If you open the developer tools in your browser, are you getting any particular errors? Is you webmap public?
... View more
09-23-2022
07:18 AM
|
0
|
0
|
4131
|
|
POST
|
You have a couple of spots where you're passing a layer, but it's not defined. if (layer.title === "Entire Structure") {
EntireStructureLayer = {
layer: EntireStructure, // EntireStructure undefined
if(layer.title === "DamagedAreasmultipatch") // missing {} too
DamagedAreasLayer = {
layer: DamagedAreasmultipatch, // DamagedAreasmultipatch undefined In those cases, if the title matches, you can just pass the layer instance for the editor to use.
... View more
09-20-2022
08:01 AM
|
0
|
1
|
3912
|
|
POST
|
You can try watching the layerView updating property. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#whenOnce view.when(async () => {
const layerView = await view.whenLayerView(layer);
await whenOnce(
() => !layerView.updating
);
console.log("map image layer done drawing");
}); You could wait for view.updating too, it's based off the child layerviews updating property.
... View more
09-13-2022
07:53 PM
|
0
|
1
|
1645
|
|
POST
|
Default values can only be set when publishing the services. Adding default values via the Editor widget is not supported.
... View more
09-09-2022
07:27 AM
|
0
|
0
|
1806
|
|
POST
|
Ah, sorry. That won't work in 4.13. That was introduced at 4.23 I think. Before that, we didn't have that option in the IdentifyParameters like in 3x. In recent 4x version, the sublayers need to come from a MapImageLayer as they need a layer source. https://codepen.io/odoe/pen/qBYbOyG?editors=1000
... View more
09-07-2022
04:00 PM
|
1
|
0
|
2741
|
|
POST
|
You can define the defintionExpression in a sublayer in the IdentifyParameters https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers You can create a MapImageLayer with your sublayers, load it, then add those sublayers to the parameters. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source
... View more
09-07-2022
01:23 PM
|
0
|
0
|
2808
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|