Skip to content

Commit

Permalink
Snapping
Browse files Browse the repository at this point in the history
  • Loading branch information
CHB committed Nov 21, 2024
1 parent 9f226d1 commit 773ddb5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web-apps/urban-sun-safe/src/compontents/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Sketch from "@arcgis/core/widgets/Sketch";
import { PolygonSymbol3D, ExtrudeSymbol3DLayer } from "@arcgis/core/symbols";
import SolidEdges3D from "@arcgis/core/symbols/edges/SolidEdges3D";
import SketchViewModel from "@arcgis/core/widgets/Sketch/SketchViewModel";
import SceneLayer from "@arcgis/core/layers/SceneLayer";

type AppProperties = Pick<App, "store">;

Expand Down Expand Up @@ -99,6 +100,9 @@ class App extends Widget<AppProperties> {
hasZ: true
}
})
const buildingLayer = view.map.allLayers.find(function(layer) {
return layer.title === Config.services.osmBuildingTitle
}) as SceneLayer;
new Sketch({
layer: graphicsLayer,
view: view,
Expand All @@ -109,6 +113,11 @@ class App extends Widget<AppProperties> {
point:false
}
},
snappingOptions: {
enabled: true,
selfEnabled: true,
featureSources: [{ layer: buildingLayer, enabled: true}]
},
viewModel: sketchViewModel,
container: sketchContainer
});
Expand Down

0 comments on commit 773ddb5

Please sign in to comment.