|
POST
|
Once you add a graphic to the FeatureLayer, the visibility/symbology is no longer managed by the Graphic, but the Layer. You can set a definitionExpression or apply a FeatureEffect.
... View more
11-13-2022
01:01 PM
|
0
|
2
|
1054
|
|
POST
|
The 4x AMD samples are deprecated as it becomes more difficult to get apps and other modern bits to play nice together. We won't be updating them. You can try updating to the latest dojo utils, with the latest closure compiler. We have a fork with 1.17.3 here. https://github.com/Esri/dojo-util/tree/v1.17.3/esri-3.42.0
... View more
11-11-2022
09:54 AM
|
0
|
1
|
1171
|
|
POST
|
It's just a way to store the timeout on the element it's related to. It's not JSAPI specific thing, just how the sample is set up. TS won't be able to type it without using any or trying to set up your own type. In a production app, you would probably store the timeouts in a HashMap with a data-attribute for look up or another similar data structure.
... View more
11-07-2022
09:43 AM
|
1
|
0
|
866
|
|
POST
|
@JS_GilbertAZ is correct. The 4x equivalent to 3x ArcGISDynamicMapServiceLayer is the MapImageLayer. It has an updated API to make it easier to configure the layers in the service. In the first screenshot, with the FeatureService, the API is going to request data in cacheable tiles, which can lead extra requests. If you are using multiple FeatureLayers to display the same layers that are in the Map Service, then that would explain the number of requests and possibly slower than expected response if they each contain a good amount of data. MapImageLayer can still perform very fast for Map Services, and if needed you can still create a FeatureLayer from a SubLayer that you an use for queries and more.
... View more
11-03-2022
08:35 AM
|
0
|
0
|
2701
|
|
POST
|
You have a second hitTest in your code there, but aren't passing the options with the target layer in the include. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest You do it the first hitTest. I tested that in your codepen and it works just like before when you do that. This sample does something similar. https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/ For your example, this works ok. But note that hitTest was updated at 4.24. https://developers.arcgis.com/javascript/latest/release-notes/#mapview-and-sceneview-hittest-updates So depending on how you are using the hitTest results, you may need to check the type like the snippet in the docs.
... View more
10-31-2022
08:32 AM
|
0
|
0
|
587
|
|
POST
|
Do you have a sample/repro in codepen maybe? Here is a sample using Sublayers with Identify https://codepen.io/odoe/pen/qBYbOyG It's important to note that you can send sublayers or layerIds, but not both.
... View more
10-18-2022
10:49 AM
|
1
|
0
|
719
|
|
POST
|
You could do the whole thing first too const latLonPolygonGeometry = webMercatorUtils.webMercatorToGeographic(graphic.goemetry); Then go over the rings. Lots of options!
... View more
10-13-2022
03:29 PM
|
0
|
0
|
1781
|
|
POST
|
Assume those are WebMercator, so you can run the polygon through the webmercatorUtils first. https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#webMercatorToGeographic
... View more
10-13-2022
03:05 PM
|
0
|
2
|
1783
|
|
POST
|
This snippet looks like you are mixing some 3x code with 4x code. For example, there is no Dojo in 4x, so you don't need to use Dojo color modules. Layers are not initialized with url string and params, it's a single constructor object. You don't provide the id, the layer will handle that. Here is a popup sample that might help. I think it has more to do with how you create the FeatureLayer https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#constructors-summary https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/
... View more
10-12-2022
09:51 AM
|
1
|
2
|
3416
|
|
POST
|
No courses, but we do have some other resources. Guide topics: Setting up your TypeScript environment - https://developers.arcgis.com/javascript/latest/typescript-setup/ Build with ES modules - https://developers.arcgis.com/javascript/latest/es-modules/ Github ESM Samples - https://github.com/Esri/jsapi-resources/tree/master/esm-samples Blog Posts Using React with the ArcGIS API for JavaScript - https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-react-with-the-arcgis-api-for-javascript/ Building ArcGIS API for JavaScript Apps with NextJS - https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/building-arcgis-api-for-javascript-apps-with-nextjs/ I have some accompanying videos for them too. ArcGIS JSAPI ESM with create-react-app - https://youtu.be/dhyMamfjvcQ Building ArcGIS API for JavaScript Apps with NextJS - https://youtu.be/UJiiNbjVTho If there is something else you think would be helpful, please let us know. Thanks!
... View more
10-11-2022
03:19 PM
|
1
|
0
|
1017
|
|
POST
|
The widget isn't extensible, so you can't add more buttons. You can use the SketchViewModel and build a custom component around that. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html Depending what you want it to do though, you could have a container that wraps the Sketch widget and your custom button along side each other, so it looks like a new button, but when you click it, you can call methods on the Sketch widget or the layer, not sure what your button would do.
... View more
10-11-2022
07:31 AM
|
1
|
0
|
2281
|
|
POST
|
For TS, you'd need to help TS a bit doing something like if (symbol.type === "simple-fill"). It's not on the base Symbol, but main classes. You'll see it sprinkled around in the doc like here. https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#clone
... View more
10-07-2022
05:14 PM
|
0
|
0
|
1438
|
|
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
|
4713
|
|
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
|
4734
|
|
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
|
1466
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM | |
| 1 | 12-31-2025 09:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|