POST
|
Yeah, any listeners you create with "on" you need to clean up. The "on" method returns an object with a "remove()" method you can use for that. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#on
... View more
a week ago
|
0
|
0
|
33
|
POST
|
This is a useful blog post that is still relevant for adding things like buttons to your popup. https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-html-with-popups-in-the-arcgis-api-for-javascript/
... View more
2 weeks ago
|
1
|
1
|
83
|
POST
|
Currently, you can use the arcgis-placement component for this. <arcgis-map>
<arcgis-placement position="top-right">
<my-custom-component></my-custom-component>
</arcgis-placement>
</arcgis-map>
... View more
3 weeks ago
|
1
|
1
|
130
|
POST
|
There's some work being done on calcite and core side for css variables like this, so at some point will be able to get conventions down as intended.
... View more
3 weeks ago
|
0
|
0
|
121
|
POST
|
You can try adjusting some of the calcite css variables. It takes a little inspection to see what variables are used where. But this works. .esri-widget--button {
--calcite-icon-color: white;
background-color: red;
}
.esri-widget--button:hover {
--calcite-icon-color: blue;
--calcite-color-foreground-2: green;
} https://codepen.io/odoe/pen/JoPGYBB?editors=1000
... View more
3 weeks ago
|
0
|
2
|
137
|
POST
|
You can use symbolUtils to help you out here. https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html const symbol = await getDisplayedSymbol(graphic);
const previewElement = await renderPreviewHTML(symbol, options);
... View more
11-15-2024
02:30 PM
|
0
|
0
|
110
|
POST
|
It's the print service, not the SDK. It's taking longer than usual to load and should be up and running in a bit.
... View more
11-13-2024
08:18 AM
|
1
|
1
|
193
|
POST
|
Because the Popup is now lazily loaded, it's not a full Popup instance until a feature with a popup template is clicked. To interact with the popup manually, there are two methods on the view you an use. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#openPopup https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#closePopup This should get you the behavior you are looking for.
... View more
11-12-2024
08:17 AM
|
0
|
0
|
220
|
POST
|
When you import the class and you type it like that, ptGraphicsLayer is of type constructor for Graphic, so it's like your telling TS it can do "new ptGraphicsLayer()". You can use a utility type to help you out here with InstanceType. import Polyline from "@arcgis/core/geometry/Polyline";
import type FeatureLayer from "@arcgis/core/layers/FeatureLayer";
import type GraphicsLayer from "@arcgis/core/layers/GraphicsLayer";
import type Layer from "@arcgis/core/layers/Layer";
import { Point } from "@esri/calcite-components/dist/types/components/graph/interfaces";
export function graphicsLayerFn(ptGraphicsLayer: InstanceType<typeof GraphicsLayer>) {
ptGraphicsLayer.graphics.forEach((element: any) => {
return element.id; // do something
});
} Now everything is much stricter and you need to update the code a bit. There is no public graphicsLayer.items.array property. You might see it in devtools, but it's not publicly typed or doc'd like that, so I updated the code to reflect those changes. Also anything you import that is only for types, you can add the "import type", it's really more for organization. TS should strip the import if it's unused or other bundlers will. But it will also give you a warning if you try to use it as anything other than a type, which can be useful.
... View more
10-28-2024
05:24 PM
|
1
|
0
|
243
|
POST
|
You can still import arcgis/core modules as needed. You could create your own Map/WebMap with whatever layers you want and provide it to the `ArcGisMap` component's `map` property. I don't have an example showing that, but this demo mixes the components and use of core. https://github.com/odoe/arcgis-map-comps-nextjs/blob/main/app/map/%5Bslug%5D/page.tsx You don't need to use the ArcGisMap ui to place your components, just don't make them children of the map component and they have a property called referenceElement you pass a reference too. This does require you have a useRef for each component and for the map to hook it up. Each component has a `referece-element`/`referenceElement` you can use. https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-search--docs In the map and scene components, you can provide your own map as well. https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs
... View more
10-22-2024
01:36 PM
|
1
|
0
|
663
|
POST
|
You can download the documentation for previous releases here. https://developers.arcgis.com/javascript/latest/downloads/
... View more
09-16-2024
01:51 PM
|
1
|
1
|
249
|
POST
|
This is going to depend on how you are building your app. Here is some documentation showing the steps to set up the esriConfig portal url. https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-amd-application https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application If you are building your app from scratch with npm, I would recommend you set up the esriConfig portal url, and any auth needed before loading your components, so something like this. esriConfig.portalUrl = something;
esriId.registerOAuthInfos([info]);
import("@arcgis/map-components/dist/loader").then(
({ defineCustomElements }) => {
defineCustomElements();
},
);
... View more
09-16-2024
08:35 AM
|
0
|
0
|
221
|
POST
|
If you had a github repro, would be easier to tell. One thing you can do is add the "autoDestroyDisabled" to your components. All the map components have it. https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs From the description: If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporary hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.
... View more
09-16-2024
07:23 AM
|
0
|
1
|
288
|
POST
|
The map and scene components have methods to add layers, addLayer and add layers. https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs So you can create a layer like you normally would and add it to the component. Here's a sample adding a graphics layer and using sketch https://codepen.io/odoe/pen/eYwzRER
... View more
09-02-2024
01:20 PM
|
1
|
0
|
564
|
POST
|
The components emit CustomEvents that wrap the native view mouse events, like CustomEvent<ViewDragEvent>. Try to `event.detail.stopPropagation()`.
... View more
08-29-2024
09:17 AM
|
0
|
0
|
279
|
Title | Kudos | Posted |
---|---|---|
1 | 2 weeks ago | |
1 | 3 weeks ago | |
1 | 10-28-2024 05:24 PM | |
1 | 11-13-2024 08:18 AM | |
1 | 10-22-2024 01:36 PM |
Online Status |
Offline
|
Date Last Visited |
Friday
|