|
POST
|
The Basemap, and other layers, have a load props you can check. https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loadError https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loadStatus https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loadWarnings You could do something like this. view.when(() => {
console.log("Check basemap error status", view.map.basemap.loadError)
});
... View more
04-14-2023
08:49 AM
|
0
|
0
|
3144
|
|
POST
|
This is going to depend on how you are using the SDK. You can't mix builds different builds. Are these different components? Like you have some pieces for displaying legend, layerlist on one port, something to handle the map on another port? One solution is to have your components take ArcGIS Modules as inputs, so your "main" application supplies the ArcGIS SDK modules and your components instantiate them. That would help to solve this issue. There is not really a clean story here.
... View more
04-12-2023
07:38 AM
|
0
|
1
|
1243
|
|
POST
|
view.map.layers.forEach((layer) => {
if (layer.type === "feature") {
view.whenLayerView(layer as FeatureLayer).then((layerView) => {
let featureLayerView = layerView;
let selectedFilter = "contains";
const featureFilter = {
geometry: geometry,
spatialRelationship: selectedFilter
};
featureLayerView.
})
.catch(console.error);
}
}); Alternatively you can do (layerView as __esri.FeatureLayerView) Either of those will work.
... View more
04-12-2023
07:32 AM
|
0
|
1
|
4025
|
|
POST
|
That's weird, I thought that would narrow it down. You can cast "layer as FeatureLayer" when you pass it to whenLayerView and that would return a FeatureLayerView then.
... View more
04-11-2023
10:40 AM
|
0
|
0
|
4051
|
|
POST
|
If you do the layer.type === "feature" before you use whenLayerView. the layer type passed should be recognized as a FeatureLayer, and the layerView will have the type FeatureLayerView. As it is, the layer being passed to the whenLayerView is just a type "Layer" and you are getting the generic "LayerView" type back, which doesn't have the filter property on it. You can always cast it too, as __esri.FeatureLayerView, but the better option is to narrow the layer type before passing it to whenLayerView to get the proper type back.
... View more
04-11-2023
06:42 AM
|
0
|
2
|
4070
|
|
POST
|
Yes, you can use the View constraints https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints Demo: https://stackblitz.com/edit/vitejs-vite-arcgis-v1-view-constraints?file=src%2Fmain.ts Video: https://www.youtube.com/watch?v=4A6xGWusgN4&ab_channel=ReneRubalcava
... View more
04-06-2023
12:33 PM
|
1
|
1
|
2420
|
|
POST
|
The import alias should still work, but might break depending on the tsconfig. With the latest TypeScript, it's recommended that you utilize type-only imports. import type FeatureLayer from "@arcgis/core/layers/FeatureLayer";
export function doSomethingWithLayer(layer: FeatureLayer) {
// super cool stuff
} If you want to do something like a factory method, where you want to type the properties used for something, you can do something like this. import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
type LayerFactoryProps = InstanceType<typeof FeatureLayer>;
export function layerFactory(props: LayerFactoryProps) {
// maybe add some defaults here
// create layer
const layer = new FeatureLayer(props);
return layer;
} Ideally, I would recommend against using the __esri namespace, unless you really need it for things like the Event types, or watch/reactiveUtil handlers. Other than that, you should avoid it.
... View more
04-04-2023
08:17 AM
|
0
|
0
|
2411
|
|
POST
|
You can use some TS utilities to help you out here. type FeatureLayerProp = InstanceType<typeof FeatureLayer>; https://www.typescriptlang.org/docs/handbook/utility-types.html#instancetypetype
... View more
04-01-2023
01:24 PM
|
0
|
1
|
1362
|
|
POST
|
You can use extent.expand(1.1) https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#expand
... View more
03-19-2023
07:25 PM
|
0
|
1
|
1333
|
|
POST
|
Yes, autocasting also contributes as it will add to the bundles as needed. Again, size on disc is not related to size used at runtime.
... View more
03-14-2023
12:45 PM
|
0
|
0
|
4758
|
|
POST
|
Do you have a sample app? codepen or github showing the issue? It could be a conflict with some other css in your app. Looks like some zoom style is set. No way to know without looking at a reproducible sample.
... View more
03-03-2023
07:34 AM
|
0
|
0
|
629
|
|
POST
|
You can try using layer.loadAll() and it should load all sublayers and child sublayers for you. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#loadAll Oh, and Sublayers is a Collection, so you can flatten it after. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#flatten
... View more
03-01-2023
10:37 AM
|
1
|
0
|
913
|
|
POST
|
You can use React Portals for using React components in your Popup. Here's a blog post on the topic. It will walk you through the steps for something like this. import { useEffect } from "react";
import { createPortal } from "react-dom";
const PopupPortal = ({ mountNode, children }) => {
const el = document.createElement("div");
useEffect(() => {
mountNode.appendChild(el);
return () => mountNode.removeChild(el);
}, [el, mountNode]);
return createPortal(children, el);
};
export default PopupPortal;
... View more
02-26-2023
10:07 AM
|
0
|
8
|
4343
|
|
POST
|
You can use Layer.fromArcGISServerUrl(), and it will load all the layers in the feature service. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl
... View more
02-25-2023
01:13 PM
|
2
|
0
|
1134
|
|
POST
|
That error means the module doesn't have a "export default something", so you can import the individual methods or all of them using "*". import * as symbolUtils from "@arcgis/core/symbols/support/symbolUtils.js"; The import syntax is shown in the doc here. https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html
... View more
02-25-2023
01:10 PM
|
0
|
3
|
2507
|
| 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
|