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
97 stars 81 forks source link

iOS not showing until user zoom out #64

Closed Pierre-Monier closed 11 months ago

Pierre-Monier commented 1 year ago

On iOS, I have an unwanted behavior with the latest version (5.3.0). I have an initial zoom level of 19 when rendering the map, and the user marker only appears if we zoom out. Here is a reproducible example :

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:latlong2/latlong.dart';

class MinimumExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Minimum Example'),
      ),
      body: FlutterMap(
        options: MapOptions(
          center: LatLng(CurrentUserLongitude, CurrentUserLatitude),
          zoom: 19,
          minZoom: 0,
          maxZoom: 19,
        ),
        children: [
          TileLayer(
            urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
            subdomains: const ['a', 'b', 'c'],
            userAgentPackageName:
                'net.tlserver6y.flutter_map_location_marker.example',
            maxZoom: 19,
          ),
          CurrentLocationLayer(),
        ],
      ),
    );
  }
}

It's the minimum example from the example app. I just set the initial zoom to 19 and change the default position to the user current location.

When running this example, you will not see the user marker directly. But if you zoom out, it will appear. If you zoom in to a zoom level 19, the marker is still there.

Here is my flutter doctor :

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.7.11, on macOS 13.3.1 22E261 darwin-arm64,
    locale en-FR)
    ! Warning: `dart` on your path resolves to
      /opt/homebrew/Cellar/dart/2.18.6/libexec/bin/dart, which is not
      inside your current Flutter SDK checkout at
      /Users/pierremonier/fvm/versions/3.7.11. Consider adding
      /Users/pierremonier/fvm/versions/3.7.11/bin to the front of your
      path.
[✓] Android toolchain - develop for Android devices (Android SDK version
    33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.77.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

(the warning is related to my use of fvm...)

I'm running on an iPad (9th generation), with the iPadOS version 16.2

Thanks :)

github-actions[bot] commented 1 year 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 1 year 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.

tlserver commented 1 year ago

Do you still have this problem on v7? Does it only happen at zoom ≥ 19?

github-actions[bot] commented 11 months 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 11 months ago

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