|
POST
|
The Collection getItemAt method doesn't know you expect to get a MapImageLayer, so you can do this const lyr = webMap.layers.getItemAt(0) as MapImageLayer;
... View more
12-10-2021
08:25 AM
|
0
|
0
|
3035
|
|
POST
|
A snippet for the typescript error would help, where you get a type mismatch on the layer. Could be as simple as doing "as Sublayer" or something like that. I don't need the whole code or data.
... View more
12-09-2021
02:39 PM
|
0
|
1
|
3064
|
|
POST
|
Oh, if you are doing this before the View and Map loads, you need to load the webmap, then load the MapImageLayer and then you can get to the sublayers. Not sure about the TS error you're getting, but if you had a github repo, could take a look. The Sublayer has a createFeatureLayer() method you can use for something like this. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer Then you can create a FeatureTable from the FeatureLayer.
... View more
12-09-2021
12:52 PM
|
1
|
3
|
3102
|
|
POST
|
You can't use one of the default basemaps if you wan to use the center in another spatial reference. When using the default basemaps it needs to be in lat/long. You can reproject your point using the projection in the API. If you only want to work in your projected coordinates, you can make the MapImageLayer the base layer and the MapView will now be in the source SR. Here is a sample doing that. https://codepen.io/odoe/pen/GRMqYBX?editors=1000 Downside to this is you need to find or publish or your own basemap data if you need it.
... View more
12-09-2021
07:22 AM
|
3
|
1
|
5103
|
|
POST
|
It depends on what your build tooling looks like. If you are not using build tools and just using the CDN, then, yes, you can use Dojo dijits and other tools with 4x. It's not recommended, as Dojo 1 is simply in maintenance mode with varying bug fixes. But if you need to transition over a few cycles, then you can. You should move your custom widgets to some other framework tooling or web components. If you are doing Dojo builds of your application, you can, but again, it is not recommended for 4x and is considered a deprecated practice. We have a repo here you can use for guidance, but no guarantees that it will work 100%. https://github.com/Esri/jsapi-resources/tree/master/4.x/amd
... View more
12-09-2021
07:12 AM
|
1
|
0
|
1668
|
|
POST
|
If the point exists on one of the vertices or along the edge of the polygon, then contains will return false, since it is not fully contained. You can try using intersects in the geometry engine to see if that will give you a better answer. Here is a demo. https://codepen.io/odoe/pen/bGopRPo?editors=0011
... View more
12-07-2021
09:56 AM
|
2
|
0
|
3491
|
|
POST
|
The samples for 4.13 are no longer available. This sample is still using the GP Task https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=geoprocessing-hotspot Here is a sample using the task in 3.x, it's very similar to how you would do it in 4.13 to get another look. https://developers.arcgis.com/javascript/3/jssamples/gp_viewshed.html
... View more
11-30-2021
09:45 AM
|
1
|
0
|
2215
|
|
POST
|
If you're using 4.13, you can use the Geoprocessor task. In current releases, it is deprecated in favor of the if the rest methods here.
... View more
11-30-2021
07:33 AM
|
1
|
2
|
2232
|
|
POST
|
Looking at the documentation, it doesn't look like you can.
... View more
11-29-2021
02:27 PM
|
0
|
0
|
1189
|
|
POST
|
It's still tough to tell, but it looks like in your code when you use applyEdits, you're not waiting for the async methods to finish before you start running queries. You could wrap some of the async calls in Promise.all(), change them to async/await, or maybe chain the promises to make sure one task is done before starting another.
... View more
11-24-2021
11:14 AM
|
0
|
1
|
5243
|
|
POST
|
You can move all the JSAPI logic into an injectable service and use that service in components you want to be able to access it. import { Injectable } from '@angular/core';
import WebMap from '@arcgis/core/WebMap';
import MapView from '@arcgis/core/views/MapView';
import Bookmarks from '@arcgis/core/widgets/Bookmarks';
import Expand from '@arcgis/core/widgets/Expand';
@Injectable({
providedIn: 'root'
})
export class MapService {
public view: MapView | null = null;
constructor() {}
async createMap(container: HTMLDivElement) {
const webmap = new WebMap({
portalItem: {
id: 'aa1d3f80270146208328cf66d022e09c'
}
});
const view = new MapView({
container,
map: webmap
});
const bookmarks = new Bookmarks({
view,
// allows bookmarks to be added, edited, or deleted
editingEnabled: true
});
const bkExpand = new Expand({
view,
content: bookmarks,
expanded: true
});
// Add the widget to the top-right corner of the view
view.ui.add(bkExpand, 'top-right');
// bonus - how many bookmarks in the webmap?
webmap.when(() => {
if (webmap.bookmarks && webmap.bookmarks.length) {
console.log('Bookmarks: ', webmap.bookmarks.length);
} else {
console.log('No bookmarks in this webmap.');
}
});
this.view = view;
return this.view.when();
}
}
... View more
11-19-2021
11:09 AM
|
0
|
0
|
2010
|
|
POST
|
Can you simplify it down, this app has a lot going on and I can't get past the login screen when the app starts. I'm going to guess there is an issue around when the MapView is added to the page and when the map and layers are ready to be drawn.
... View more
11-19-2021
07:33 AM
|
0
|
3
|
5263
|
|
POST
|
It's unclear, but if you can provide a sample, might be able to help. Could be in the type of layer, definitionExpression, some query, arcade expression maybe. Not an easy way to see without a demo to test against.
... View more
11-17-2021
05:12 PM
|
0
|
1
|
2254
|
|
POST
|
Try in this sample. https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=widget_directions_basic Update the code like this. directions.startup();
// after startup()
directions.setDirectionsLanguage("fr"); This worked for me. I think that method has to be called after the startup() method.
... View more
11-17-2021
02:36 PM
|
1
|
1
|
2314
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Wednesday | |
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|