Last active
May 12, 2020 11:38
-
-
Save RalucaNicola/9b00722c0b0c21e840479f6eeaeaea0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sketchLayer = new GraphicsLayer({ | |
elevationInfo: { | |
mode: "on-the-ground" | |
} | |
}); | |
webscene.add(sketchLayer); | |
const sketchViewModel = new SketchViewModel({ | |
layer: sketchLayer, | |
view: view | |
}); | |
sketchViewModel.on("create", function (event) { | |
if (event.state === "complete") { | |
console.log(event.graphic.geometry); | |
// apply a spatial filter on the buildings | |
// using the graphic's geometry | |
} | |
}); | |
document.getElementById("drawPolygon").addEventListener("click", function () { | |
sketchViewModel.create("polygon"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment