I am new to ArcGIS API for JS, and JS in general, but so far I like the API quite a lot.
I'm building a webpage with two sketches. Each sketch contains graphics. Sketch 1 is for user to input and interact. Sketch 2 is for results. So far everything is running normally in the script, but ...
I am looking for a way to disable the editing of Sketch 2 (or make it non-selectable) , but not sure what flags I should turn off. My snippet is below, and thanks for the advice
const graphlayer1 = new GraphicsLayer();
const graphlayer2 = new GraphicsLayer();
const map = new Map({
basemap: "satellite",
layers: [graphlayer1 ,graphlayer2 ]
});
const view = new MapView({
container: "viewDiv",
map: map,
zoom: 18,
center: [-114.000,51.000]
});
const sketch1 = new Sketch({
layer: graphlayer1,
view: view,
availableCreateTools:["point", "polyline", "polygon"],
creationMode: "update",
});
// Need to make the following a display only container. Its contents will be updated in the code
const sketch2 = new Sketch({
layer: graphlayer2,
view: view,
availableCreateTools:[],
creationMode: "update"
});
view.ui.add(sketch1, "top-right");
Solved! Go to Solution.
Hello @MichelMorgan ,
To disable scale, rotation and move, try by adding below properties
Hello @MichelMorgan ,
To disable scale, rotation and move, try by adding below properties
That did the job. Thanks!
Is there a way to turn off the ability to select a graphic at all once it's been drawn?
Hello Kathrynb95. Did you ever find a way to do this?