We are trying to integrate the ESRI Maps in a React Application. Using ARCGIS API for JS 4.24, we are able to draw the map and add features like marker and boundary on the map.
Now, we need to edit the geometry on the map by performing various operations like draw polygon, circle, split, move , delete etc. We could not find anything in the ARCGIS API for JS 4.24.
The document has some examples for ARCGIS API for JS 3.42 but in this case we are not able to render the map.
Using the code like below , we are getting the error : "Module not found: Error: Can't resolve 'esri/Map'"
Solved! Go to Solution.
Good. It got resolved.
You can see the knowledge content from Sri. Rene Rubalcava, on geometry engine recently sir published a video on yotube.
Keep on Mapping...
Hi @JayakumarPD
I will try to rephrase my requirement. For ex : I have 2 polygons initially and i need to split them into 4 using a polyline(cutter).
Query : How can i pass these 2 polygons to get the new splitted polygon's geometry because as per the documentation, the cut method accepts a single geometry.
const geometries = geometryEngine.cut(polygon1, line1);
// here i can pass only single polygon
The concern is to split multiple polygons into another set of multiple polygons.
Anyone could help me in this please
You can iterate over polygon and apply the cut geometry
if (isCrossed) {
rings1.map((x) => {
const iteratingGeometry = new Polygon({
rings: x,
hasZ: false,
hasM: false,
spatialReference: { wkid: 102100 },
});
const geometries = geometryEngine.cut(iteratingGeometry, line1);
console.log(geometries);
Will it be helpful