|
POST
|
Do you need to have the assets copied locally? Looks like something in the build is causing an issue there. You can remove the config.assetsPath part and load the assets from the CDN. Everything seems to work after that.
... View more
08-04-2022
11:08 AM
|
0
|
3
|
3432
|
|
POST
|
When creating the Point with x/y, you also need to set the spatialReference. If you know the SR matches the the map, you can use view.SpatialReference. geometry: new Point({
x: event.value.x, y: event.value.y,
spatialReference: view.spatialReference // set sr of Point
}),
... View more
08-04-2022
10:13 AM
|
0
|
0
|
1725
|
|
POST
|
Can you break this down to simpler reproducible sample without routing, auth and environment variables in a github repo? Can't tell from what you've posted. Only Vue2 app I have is this one, but it's a few years old and not sure it works anymore. It could be something in the dependencies or some other unknown. https://github.com/odoe/jsapi-vue-template
... View more
08-04-2022
09:36 AM
|
0
|
0
|
3448
|
|
POST
|
One of the options for the geometryEngine buffer is unionResults https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer This will return a single buffer geometry for all the geometries buffered and you can use that in the filter.
... View more
08-03-2022
03:08 PM
|
1
|
1
|
2332
|
|
POST
|
Without user interaction for ArcGIS Online, no. The user has to log in at least once, then they can return to the page without having to log in again. Online defaults to two-week credentials I believe. https://community.esri.com/t5/arcgis-api-for-javascript-videos/identitymanager-in-the-arcgis-api-for-javascript/m-p/1191710#M21
... View more
08-01-2022
08:31 AM
|
0
|
0
|
938
|
|
POST
|
It looks like you are trying to use 4x syntax in a 3x app. The FeatureLayer API in 3x is slightly different. You can just pass the URL. https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#featurelayer1 If you have the itemId, you can get the item and get the URL off of that https://developers.arcgis.com/javascript/3/jsapi/esri.arcgis.utils-amd.html#getitem
... View more
08-01-2022
08:27 AM
|
0
|
0
|
1457
|
|
POST
|
That's expected. So you want to show the vertices of the polygon as points? You'll need to break it down to points using something like the explode utility I linked above. Polygons -> Polylines -> Points
... View more
07-26-2022
07:39 AM
|
0
|
0
|
1237
|
|
POST
|
require(["esri/config","esri/views/MapView", "esri/WebMap"],
(esriConfig, MapView, WebMap) => {
// you are overriding the esriConfig object you imported
// var esriConfig = {
// portalUrl: "https://domain/portal/home/",
// };
esriConfig.portalUrl = "https://domain/portal/home/";
const webmap = new WebMap({
portalItem: {
// autocasts as new PortalItem()
id: "c1127b4c1e3e4ab9bd3005192f6e6731"
}
});
const view = new MapView({
map: webmap,
container: "viewDiv"
});
}); Or if you want to make the esriConfig global, you can do this. You don't need to import or reference it in your own JavaScript if you do this. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Testing</title>
<style>
#viewDiv {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.24/esri/themes/dark/main.css" />
<script>
// If ou define it globally here
// the API will pick it up.
// But should be in the head
// so it is created before the API
var esriConfig = {
portalUrl: "https://domain/portal/home/",
};
</script>
</head>
<body>
<div id="viewDiv"></div>
<script src="https://js.arcgis.com/4.24/"></script>
<!-- Do not add the esriConfig your JavaScript if you do this -->
<script src="js/test_main.js"></script>
</body>
</html>
... View more
07-25-2022
02:45 PM
|
1
|
2
|
5160
|
|
POST
|
if you are going to use the esriConfig global object, you need to put it in a script tag above the one that imports the map modules. Or you can import the esriConfig like you did and set the portalUrl on it You can't do both in the same script tag
... View more
07-25-2022
01:44 PM
|
0
|
4
|
5172
|
|
POST
|
Set the portalUrl of the esriConfig object you import, you're creating a new object and overwriting the default one. https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl esriConfig.portalUrl = "https://myHostName.esri.com/arcgis"
... View more
07-25-2022
01:17 PM
|
0
|
6
|
5191
|
|
POST
|
Do you want to render the vertices of the polygon to points? Or the center of the polygons to points? You would need to break the polygon into polylines and the polylines into points. I have a utility you can use for that. https://github.com/odoe/explode/ For the render to polygon to points, you can define the renderer to display points and it will use the centroid of the polygon. https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html The center can be a little off if it's an oddly shaped polygon, like a horse shoe or something.
... View more
07-25-2022
08:14 AM
|
0
|
0
|
1258
|
|
POST
|
FeatureLayers, by design with a FeatureService can only have a single geometry type. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType So if you have points, lines, polygons, you need a FeatureLayer for each.
... View more
07-22-2022
08:26 AM
|
0
|
0
|
1315
|
|
POST
|
Ok, I think you need to simplify your sample a bit to get to the bare minimum and work up from there. Looks like I was incorrect about removing graphics from the graphicsLayer used by SketchViewModel. If you no longer want to use them in a Sketch, you can remove them, but if you still want to see them, you need move to another graphicsLayer not used by Sketch. There's some snippets using this pattern for when you use sketch.create(), but you are sketching your own graphics with sketch.update(), so it's slightly different, as you provided the graphic for the SketchViewModel. Here is a super simple sample showing how to sketch a given graphic, and finish the sketch. https://codepen.io/odoe/pen/abYWVaK?editors=0010 I think in your previous example, you are trying to delete things before completing the Sketch action and that's causing issues. // on click, stop the sketch actions
sketchBtn.addEventListener("click", () => {
// if the sketch is currently active
// we can complete the action
if (sketchViewModel.state === "active") {
sketchViewModel.complete();
}
});
sketchViewModel.on("update", (event) => {
// this fires after sketchViewModel.complete()
if (event.state === "complete") {
// you do need to remove graphics from
// the grapicsLayer so they are not part
// sketch updates
graphicsLayer.removeMany(event.graphics);
// move it to another graphics layer
// so I can still see it, but not sketch it
// anymore
view.graphics.addMany(event.graphics);
}
});
const clickHandle = view.on("click", ({ mapPoint }) => {
clickHandle.remove();
const graphic = new Graphic({
geometry: mapPoint
});
graphicsLayer.add(graphic);
sketchViewModel.update(graphic, {
tool: "move"
});
});
... View more
07-20-2022
07:02 PM
|
1
|
0
|
4057
|
|
POST
|
Technically, this is what the Editor widget is for. But if you really wanted to, you could pass the graphics from the Sketch widget into the featureLayer.applyEdits, but kind of seems like the long way to get there. Plus you would need to populate the attributes in some way. You would need a separate FeatureLayer per geometry type as well.
... View more
07-20-2022
08:40 AM
|
0
|
2
|
1331
|
|
POST
|
What does the print service parameters page look like? I didn't know you could specify a custom image parameter in the publishing tools for layouts, but knowing what it expects would help.
... View more
07-20-2022
08:36 AM
|
0
|
0
|
1585
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|