|
POST
|
Oops, sorry, it should be: const { latitude, longitude } = event.position.coords; Tested it using a location in your layer and it works.
... View more
08-19-2021
11:04 AM
|
0
|
5
|
3707
|
|
POST
|
The JSAPI doesn't support cooked attributes in vector tiles. Only layer ids to update styles.
... View more
08-19-2021
10:08 AM
|
0
|
0
|
2127
|
|
POST
|
You can listen for the Locate widget "locate" event. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event-locate This gives you a geolocation position. You can then turn this into a screenPoint, use view.toScreen() https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toScreen Make sure to instantiate the lat/long as a new Point. Then you can use the View hitTest to find any data at that location. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest locate.on("locate", (event) => {
const { latitude, longitude } = event.position.coords;
const screenPoint = view.toScreen(new Point({ latitude, longitude }));
view.hitTest(screenPoint).then((hitTestResult) => {
console.log(hitTestResult);
});
}); Alternatively, you can use the point as a the geometry of a query to find the data as well. https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query-basic/
... View more
08-19-2021
09:12 AM
|
1
|
7
|
3727
|
|
POST
|
You can set the spatialReference on the MapView https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#spatialReference but your basemap also needs to match. The default esri basemaps are all web mercator and can't be reprojected.
... View more
08-18-2021
07:52 AM
|
1
|
0
|
1618
|
|
POST
|
view.when() is the preferred async method. view.then() was deprecated some time ago when the Promise spec was finalized and we had to make some changes in the API.
... View more
08-17-2021
01:43 PM
|
1
|
0
|
5797
|
|
POST
|
Is this what you are looking for? https://codepen.io/odoe/pen/MWmdNOY?editors=0010 Issue with snippet you have is the layer has not loaded, so the full extent is not known yet. If you wait for view.when(), the layer will be loaded and the fullExtent will be available.
... View more
08-17-2021
01:15 PM
|
1
|
1
|
5801
|
|
POST
|
You can wait for the default source to get loaded and change the result symbol of the source. searchWidget.allSources.on("after-add", ({ item }) => {
item.resultSymbol = new SimpleMarkerSymbol({
style: "diamond",
outline: { color: [255, 255, 255, 1] },
color: [110, 247, 54, 1],
size: 32
});
}); https://codepen.io/odoe/pen/WNjmPgd?editors=1000
... View more
08-13-2021
10:51 AM
|
2
|
2
|
5559
|
|
POST
|
Ha, it's been a minute since I used ruby/rails, but I'll see what I can do. If you have a project, that would help, but I can try and put one together.
... View more
08-11-2021
05:33 PM
|
0
|
2
|
2299
|
|
POST
|
Not sure. Does this happen in a particular browser/os combo? I put that snippet in a webpack build here and the build seems to be working ok. https://github.com/odoe/jsapi-webpack-fl Do you have a repro project we can test against?
... View more
08-11-2021
02:20 PM
|
0
|
4
|
2310
|
|
POST
|
What does your build set up look like? We have a number of ESM samples here you can check against. https://github.com/Esri/jsapi-resources/tree/master/esm-samples
... View more
08-11-2021
12:53 PM
|
0
|
6
|
2338
|
|
POST
|
Not sure, but this works https://codepen.io/odoe/pen/XWRPazr?editors=0010
... View more
08-05-2021
09:18 AM
|
0
|
0
|
4208
|
|
POST
|
Ok, I checked this out. "png" is not a format option. It's png8 or png32. Change that and it should work. https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-PrintTemplate.html#format
... View more
08-04-2021
09:44 AM
|
0
|
0
|
4233
|
|
POST
|
It would look like this. require([
"esri/rest/print"
], function(print) {
print.execute(url, params);
}); The execute method exists on the print module you imported. The code snippet in the doc assumes you are using ES6 import syntax. import { execute } from "@arcgis/core/rest/print";
execute(url, params);
... View more
08-04-2021
08:20 AM
|
1
|
5
|
4260
|
|
POST
|
You can query the features you're interested in, iterate them and run .toJSON() on each feature. There's no quick way to export all features to JSON though, due to stuff like server query limits. Oh and FeatureLayer queries return a FeatureSet, and that has a toJSON() method on it too. https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html
... View more
08-03-2021
07:47 AM
|
0
|
1
|
3383
|
|
POST
|
4.21 is not 100% stable, it's the "next" release of the API. If you can provide a repro case, we can take a look if you make an issue here https://github.com/Esri/feedback-js-api-next
... View more
08-03-2021
07:44 AM
|
0
|
1
|
1685
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 2 weeks ago | |
| 1 | a month ago | |
| 2 | 4 weeks ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM |
| Online Status |
Online
|
| Date Last Visited |
Friday
|