tlserver / flutter_map_location_marker

A flutter map plugin for displaying device current location.
https://pub.dev/packages/flutter_map_location_marker
BSD 3-Clause "New" or "Revised" License
98 stars 83 forks source link

centerCurrentLocationStreamController.add(17) zoom doesn't work like before #19

Closed bmason8 closed 2 years ago

bmason8 commented 2 years ago

After upgrading to v_3.0.0 centering the location marker doesn't work for me like in v_2.0.0. Before it would zoom to the level entered as the parameter in centerCurrentLocationStreamController.add(17);. Now it will center the icon but won't zoom to the correct level. It just zooms in a tiny bit each time I make the call. I'm hoping I'm just doing something wrong but if I am I can't see where.

Here's how I'm setting up the Marker widget:

LocationMarkerLayerWidget(
                  options: LocationMarkerLayerOptions(
                    accuracyCircleColor: Colors.deepPurple.shade100.withOpacity(0.3),
                    headingSectorColor: Colors.deepPurple.shade300.withOpacity(0.8),
                    marker: DefaultLocationMarker(
                      color: (_mapControlNotifier.trackingStatus) ? Colors.deepPurple.shade300 : tmSecondary,
                    ),
                    positionStream: const LocationMarkerDataStreamFactory().geolocatorPositionStream(
                      stream: Geolocator.getPositionStream(
                        locationSettings: const LocationSettings(
                          accuracy: LocationAccuracy.high,
                          distanceFilter: 1,
                        ),
                      ),
                    ),
                  ),
                  plugin: LocationMarkerPlugin(
                    centerCurrentLocationStream: _mapControlNotifier.centerCurrentLocationStreamController.stream,
                    centerOnLocationUpdate: _mapControlNotifier.centerOnLocationUpdate,
                  ),
                ),

I'm also finding that the heading is now off. Moving my phone a couple of degrees will spin the header 360 degrees or more. Any help would be appreciated.

tlserver commented 2 years ago

You mentioned two issue.

1) The zooming by sending single to centerCurrentLocationStream stop before it complete. I found that the map stop zooming if the location is updated with CenterOnLocationUpdate.always during the zooming. This may cause this problem. Please try v3.0.1, it should fix this problem.

2) The header is spinning unexpectedly. It is because of the unit of heading (degree and radius) do not match. Sorry about that. This problem also be fixed in v3.0.1.

m-wasilewski commented 2 years ago

@tlserver I found another case/error.

When we turn off CenterOnLocationUpdate.always marker stopped follow us. It wokred in v2

v2

https://user-images.githubusercontent.com/28801475/152350328-0be93e74-1ffd-461c-9416-38a7b2104708.mov

v3

https://user-images.githubusercontent.com/28801475/152350229-65432819-7828-475f-9bdd-ede141723a8e.mov

tlserver commented 2 years ago

Have you try the example provided in the repo? Is it work? Can you show me how you build the FlutterMap?

github-actions[bot] commented 2 years ago

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.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 7 days with no activity.