Closed canismayorisxl closed 1 year ago
Quick reply, I added a piece of code that allows for disabling location mocking. It looks as followed.
in current_location_layer.dart add
final bool? disableMocking; // add this.disableMocking in the constructor. // change the location stream to positionStream = positionStream ?? const LocationMarkerDataStreamFactory() .fromGeolocatorPositionStream( disabledMockedLocation: disableMocking ?? false)
In data_stream_factory change the function to this:
Stream<LocationMarkerPosition?> fromGeolocatorPositionStream({ Stream<Position?>? stream, bool disabledMockedLocation = false, }) { return (stream ?? defaultPositionStreamSource()).map((Position? position) { return position != null && (disabledMockedLocation && !position.isMocked) ? LocationMarkerPosition( latitude: position.latitude, longitude: position.longitude, accuracy: position.accuracy, ) : null; }); }
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
As you said this requirement can be fulfilled by providing a filtered position stream. Not planed to change the library.
Hello the title is my question :-)