I'm trying to limit the Quick Report app so that points can only be collected if they are within a certain geographic area.
I have defined my limiting polygon within the mapView:
ServiceFeatureTable {
id: countyBoundary
url: "https://hangis.hanoverva.gov/arcgis/rest/services/county_boundary/MapServer"
}<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I added a geometry check within the nextPage function so it will not allow the user to proceed if the point is not within the polygon:
function nextPage(){
positionSource.active = false;
app.theNewPoint = mapView.currentViewpointCenter.center;
var withinCounty = GeometryEngine.within(app.theNewPoint, countyBoundary)
console.log("withinCounty", withinCounty)
if(withinCounty === true) {
next("");
}
else {
invalidGeometryAlertBox.text = qsTr("Invalid geometry. Point not within Hanover County.")
invalidGeometryAlertBox.visible = true;
}
}The problem is I keep getting false for withinCounty, even when the point is within the county boundary.