onLongPress method
void
onLongPress(
- LatLng latLng
)
override
Implementation
@override
void onLongPress(LatLng latLng) async {
if (_editPolyline != null) {
return;
}
LatLngBounds bounds = await mapController.getVisibleRegion();
Polygon polygon = Polygon(
polygonId: PolygonId(kManualGeofencePolygon + DateTime.now().toString()),
points: PolygonUtil.getBoxAroundAPoint(latLng, bounds),
strokeWidth: manualGeofenceConfig.strokeWidth,
fillColor: manualGeofenceConfig.fillColor,
strokeColor: manualGeofenceConfig.strokeColor,
);
await mapController.updateGeometries(
polygons: {polygon},
autoRender: false,
);
await markPolygonForEdit(polygon);
}