Giter Club home page Giter Club logo

platform_maps_flutter's Introduction

platform_maps_flutter

A Flutter package that provides a native map to both Android and iOS devices.

The plugin relies on Flutter's mechanism for embedding Android and iOS views. As that mechanism is currently in a developers preview, this plugin should also be considered a developers preview.

This package combines the google_maps_flutter plugin with apple_maps_flutter to create a cross platform implementation of native maps for Android/iOS.

Screenshots

Android iOS
Example 1 Example 2
Example 1 Example 2

Current functionality

  • Camera movement including bearing, heading, tilt (also animated)
  • Markers, including custom marker images and Info windows
  • Different map types
  • Map manipulation, enable/disable gestures, show current location, show compass ...

iOS

You will have to add the key Privacy - Location When In Use Usage Description with the value of your usage description.

Android

Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:

<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>

Sample Usage

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PlatformMap(
        initialCameraPosition: CameraPosition(
          target: const LatLng(47.6, 8.8796),
          zoom: 16.0,
        ),
        markers: Set<Marker>.of(
          [
            Marker(
              markerId: MarkerId('marker_1'),
              position: LatLng(47.6, 8.8796),
              consumeTapEvents: true,
              infoWindow: InfoWindow(
                title: 'PlatformMarker',
                snippet: "Hi I'm a Platform Marker",
              ),
              onTap: () {
                print("Marker tapped");
              },
            ),
          ],
        ),
        myLocationEnabled: true,
        myLocationButtonEnabled: true,
        onTap: (location) => print('onTap: $location'),
        onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
        compassEnabled: true,
        onMapCreated: (controller) {
          Future.delayed(Duration(seconds: 2)).then(
            (_) {
              controller.animateCamera(
                CameraUpdate.newCameraPosition(
                  const CameraPosition(
                    bearing: 270.0,
                    target: LatLng(51.5160895, -0.1294527),
                    tilt: 30.0,
                    zoom: 18,
                  ),
                ),
              );
            },
          );
        },
      ),
    );
  }
}

Suggestions and PR's to make this plugin better are always welcome. Please notice that the features provided by this package depend on the apple_maps_flutter plugin, which will improve in the future.

platform_maps_flutter's People

Contributors

aloisdeniel avatar janoschp avatar jonbhanson avatar luisthein avatar mobilemon avatar renefloor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform_maps_flutter's Issues

[iOS] Scroll becomes locked when using in combination with 'sliding_up_panel'

I have a strange behaviour when using a PlaformMap in a SlidingUpPanel (from sliding_up_panel package), the scroll works at first but then stop working after opening and closing the panel.

import 'package:flutter/material.dart';
import 'package:platform_maps_flutter/platform_maps_flutter.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({
    Key key,
  }) : super(key: key);

  Widget _map() {
    return PlatformMap(
      initialCameraPosition: CameraPosition(
        target: const LatLng(47.6, 8.8796),
        zoom: 16.0,
      ),
      markers: Set<Marker>.of(
        [
          Marker(
            markerId: MarkerId('marker_1'),
            position: LatLng(47.6, 8.8796),
            consumeTapEvents: true,
            infoWindow: InfoWindow(
              title: 'PlatformMarker',
              snippet: "Hi I'm a Platform Marker",
            ),
            onTap: () {
              print("Marker tapped");
            },
          ),
        ],
      ),
      myLocationEnabled: true,
      myLocationButtonEnabled: true,
      onTap: (location) => print('onTap: $location'),
      onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
      compassEnabled: true,
      onMapCreated: (controller) {
        Future.delayed(Duration(seconds: 2)).then(
          (_) {
            controller.animateCamera(
              CameraUpdate.newCameraPosition(
                const CameraPosition(
                  bearing: 270.0,
                  target: LatLng(51.5160895, -0.1294527),
                  tilt: 30.0,
                  zoom: 18,
                ),
              ),
            );
          },
        );
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return SlidingUpPanel(
      panel: Center(
        child: Text("This is the sliding Widget"),
      ),
      body: _map(), // <----
    );
  }
}

Cannot build with Dart 2.16 and Flutter 2.10.0 on Android

Cannot build with Dart 2.16 and Flutter 2.10.0 on Android
When I updated to Dart 2.16 and Flutter 2.10.0 I cannot build my Flutter project which was working before .

Could it be any depedency of apple_maps_flutter plugin which is not implemented on Android ?

To Reproduce

  1. After flutter run I got:
    Launching lib\main.dart on JSN L21 in debug mode...
    Plugin project :apple_maps_flutter not found. Please update settings.gradle.

FAILURE: Build failed with an exception.

  • Where:
    Script 'c:\install\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 421

  • What went wrong:
    A problem occurred evaluating root project 'android'.

A problem occurred configuring project ':app'.
Cannot invoke method afterEvaluate() on null object

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s

Exception: Gradle task assembleDebug failed with exit code 1

flutter doctor
[√] Flutter (Channel stable, 2.10.0, on Microsoft Windows [Version 10.0.19044.1466], locale cs-CZ)
• Flutter version 2.10.0 at c:\install\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5f105a6ca7 (6 days ago), 2022-02-01 14:15:42 -0800
• Engine revision 776efd2034
• Dart version 2.16.0
• DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at C:\Users\xxxxxxxx\AppData\Local\Android\sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.9)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.32106.194
• Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 2021.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[√] Connected device (4 available)
• JSN L21 (mobile) • MUENW19121002442 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1466]
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.76

[√] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!


Part of app_plugin_loader.gradle:

def object = new JsonSlurper().parseText(pluginsFile.text)
assert object instanceof Map
assert object.plugins instanceof Map
assert object.plugins.android instanceof List
// Includes the Flutter plugins that support the Android platform.
object.plugins.android.each { androidPlugin ->
assert androidPlugin.name instanceof String
assert androidPlugin.path instanceof String
def pluginDirectory = new File(androidPlugin.path, 'android') // issue ?
assert pluginDirectory.exists()
include ":${androidPlugin.name}"
project(":${androidPlugin.name}").projectDir = pluginDirectory
}

IOS: onTap function never gets called for InfoWindow onTap

Basically used the example with the controller Future removed and an onTap event added to InfoWindow


import 'package:platform_maps_flutter/platform_maps_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
//        width: 300,
//        height: 300,
        child: PlatformMap(
          initialCameraPosition: CameraPosition(
            target: const LatLng(47.6, 8.8796),
            zoom: 16.0,
          ),
          markers: Set<Marker>.of(
            [
              Marker(
                markerId: MarkerId('marker_1'),
                position: LatLng(47.6, 8.8796),
                consumeTapEvents: true,
                infoWindow: InfoWindow(
                  title: 'PlatformMarker',
                  snippet: "Hi I'm a Platform Marker",
                  onTap: () {
                    print('InfoWindow tapped');
                  }
                ),
                onTap: () {
                  print("Marker tapped");
                },
              ),
            ],
          ),
          mapType: MapType.satellite,
          onTap: (location) => print('onTap: $location'),
          onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
          compassEnabled: true,
          onMapCreated: (controller) {
          },
        ),
      ),
    );
  }
}

Also, is there any way to display the InfoWindow programmatically? Or at least a property indicating if its displayed at render time or not... thanks... this is a really useful map plugin so keep up the good work...

Update Apple Maps Dependecy

Hi,

This is more of an info request I suppose, but are there differences between using apple_maps_flutter 1.2 and the one in this library 1.0?

If so, would it be possible to update the internal dependecies?

Enhancement for Polyline::onTap

Is your feature request related to a problem? Please describe.
I use polylines to circumscribe a region (defined by markers) and when a user click on a Polyline I want to add a marker where they tap and insert the marker into my marker list. Currently, when a user taps on the Polyline, I have no way of telling where they selected. This requires me to calculate the midpoint and drop the marker there. The user then has to drag the marker to the final destination which is annoying for the user.

Describe the solution you'd like
I would like the Polyline onTap method to pass the the Polyline selected and the position on the map they tapped

eg. line.onTap = process(Polyline polyline, LatLng position) => do stuff

Providing the Polyline (that was tapped) allows generic functions to be used (not required, but nice to have)
Providing the position allows an application to reason about where on the line the tap occurs. In may case, the position to drop the marker

Describe alternatives you've considered
Currently calculate the midpoint of the Polyline. This is annoying for the user as they have to reposition the marker

consumeTapEvent doesn't seem to be working

On android, with consumeTapEvent set to true, the map shouldn't recenter on the marker that was tapped.

However, with this being true it still moves the map when I tap on the marker.

How to move a marker?

Hello! I'm building an app with a real-time location widget that shows the current location of the user on a map. How can I move the marker to the new position? The controller can not access to the markers property.

Thank you

"My Location"-button and compass are overlaid when an apple map is shown in full screen

Describe the bug
The location button and the compass are overlapping.

To Reproduce

Open the map in full screen like so

    showGeneralDialog(
      context: context,
      pageBuilder: (context, _, __) {
        return PlatformMap(
          initialCameraPosition: CameraPosition(target: LatLng(0, 0)),
          myLocationEnabled: true,
          myLocationButtonEnabled: true,
        );
      },
    );

Expected behavior
The location button should have an offset relative to the safe area, not to the screen. Just like the compass does.

Screenshots
81ACB5AD-73BF-47D0-B074-AA563755B175

Smartphone (please complete the following information):

  • Device: iPhone 12 pro
  • Version 1.0.2

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.4 20F71 darwin-x64, locale en-US)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.60.1)
[✓] Connected device (2 available)
    ! Error: i is busy: Copying cache files from device. Xcode will continue when i is finished. (code -10)

! Doctor found issues in 2 categories.

Screenshot not available

please provide the screenshot of the package in the readME, so people can know if the package is what they need or not.. We don't have to go through the stress of testing

Null Safety

Thanks for the great package!

Do you plan to make a null safe update of the package?

IOS: getting errors in Xcode after upgrade

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:2: error: invalid component of Swift key path
    \(CGFloat(annotation.calloutOffset.y))")
     ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:1: error: expression type 'WritableKeyPath<_, _>' is ambiguous without more context
    \(CGFloat(annotation.calloutOffset.y))")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:119:68: error: extra argument 'whereSeparator' in call
                let lines = annotation.subtitle?.split(whereSeparator: \.isNewline)
                                                                       ^~~~~~~~~~~
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    /Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+4/ios/Classes/Annotations/AnnotationController.swift:114:39: error: unterminated string literal
    \(CGFloat(annotation.calloutOffset.y))")
                                          ^
    note: Using new build system
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPad Air (3rd generation).

Scaling custom marker icon via BitmapDescriptor ImageConfiguration argument doesn't seem to work for android

This code works fine for IOS and the icon gets scaled to a size I'm happy with for my marker assets (png at 177x240px):

Future<BitmapDescriptor> getAssetImage(String path, BuildContext context) {
      double dpr = MediaQuery.of(context).devicePixelRatio;
      ImageConfiguration config = ImageConfiguration(devicePixelRatio: dpr*2.0,);
      return BitmapDescriptor.fromAssetImage(config, path);
}

For Android, no matter what I pass for the devicePixelRatio, I always get the same size marker icon.

Note, that this might be a bug in the google map implementation since there seem to be similar issues - flutter/flutter#24865

Also, there are some alternative suggestions to size a marker via stackoverflow, but your version of BitmapDescriptor does not implement the fromBytes static method.

Problem with user location

I'm using Apple maps from Platform maps package. Location permissions granted to always allow. myLocationEnabled set to true, but there is no user marker on maps. Only when i added myLocationButtonEnabled: true , i see user area by clicking on user location button. Strange behaviour, but i saw this marker only once after update to latest version.

Mac OS Desktop Support

Screen Shot 2020-05-14 at 11 09 34 AM

On MacOS I see a "Platform not yet implemented" message - is there any timeframe for Mac OS Desktop support for flutter which is quickly becoming more richly supported by the flutter team?

Thank you!

Platform exception - Android

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'apple_maps_flutter'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.19.0-2.0.pre.34, on Mac OS X 10.15.4 19E287, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.45.0)
[✓] VS Code (version 1.24.1)
[✓] Connected device (4 available)

• No issues found!

Documentation screenshots not loading

Describe the bug
When visiting https://pub.dev/packages/platform_maps_flutter, the four example screen shots are not appearing.

When manually following the links to each image, the following error is returned: "Error Fetching Resource".

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://pub.dev/packages/platform_maps_flutter
  2. Scroll down to 'Screenshots'
  3. See error that all four images failed to load

Expected behavior
The screenshots should be visible.

Map takes tap event when tap is performed on marker

Hello,
I have added a feature to add pins on tap of map. Pin also displays info window when tap is performed on pin. When I tap on pin to open info window, map also adds new pin because map takes tap event. I could not find anything to fix it and looks like a defect.

setMapStyle?

Does this package support Google Map styling? I need to force it to dark maps and I see

GoogleMapController mapController;
GoogleMap(
  onMapCreated: (GoogleMapController controller) {
    mapController = controller;
    mapController.setMapStyle(_mapStyle);
  }
);

I don't see how to do it in this package, is it possible?

Error when trying to build the app

Hello there, once I saw the package I think it's great so I converted my GoogleMap widget into PlatformMap widget but when I tried to build the apk for the project it throws an error and here is it :-

Running Gradle task 'assembleRelease'...                        
Running Gradle task 'assembleRelease'... Done                     357.1s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin apple_maps_flutter...
Running Gradle task 'assembleAarRelease'...                             
Running Gradle task 'assembleAarRelease'... Done                   12.2s


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'apple_maps_flutter'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.   

* Get more help at https://help.gradle.org

BUILD FAILED in 11s


The plugin apple_maps_flutter could not be built due to the issue above.

So how can I solve it??

Disable 3D Building on Map

Hello,
I implemented the CameraUpdate function but I noticed that the map is rendered by inserting the buildings in 3D.
I wanted to know is it possible to disable the visualization of buildings in 3D?
Thank you

Lite mode and map toolbar booleans

Great package, thanks for your effort on this!

Would it be possible for you to add options for lite mode and enable/disable toolbar in the Google map? Would be very helpful in my application.

Thanks!

Expected FlutterAnnotation but found MKUserLocation

Hello!

We are looking at using your package to gain access to the platform's native maps with as little platform-specific code as possible, and it should be very useful for us so thanks!

However I am getting the following error (iOS):
Expected FlutterAnnotation but found MKUserLocation: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1100.2.259.70/swift/stdlib/public/core/ArrayBuffer.swift, line 354

when myLocationEnabled is set to true.

Usage:
Screen Shot 2019-11-06 at 3 22 31 PM

Please let me know if this can be resolved. I also wouldn't mind contributing if pointed in the right direction. Thanks!

EDIT: An additional piece of info - the initial rendering of the map works, but a subsequent rebuild of the widget causes a crash.

IOS: there's still some swift compiler errors

/Users/me/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.1.2+5/ios/Classes/Annotations/AnnotationController.swift:120:68: Extra argument 'whereSeparator' in call

in XCode Version 11.3.1 (11C504)

changed line:

let lines = annotation.subtitle?.split(whereSeparator: \.Newline)

to

let lines = annotation.subtitle?.split(separator: "\n")

and compiled and ran anyway.

apple maps double tap to zoom doesn't fire callback for new position

Only on apple maps, if I double tap the map to zoom in, the onCameraMove callback is not fired.

In addition, the controller is out of sync with regards to the bounding box. So, when I double tap zoom in, and call controller.getVisibleBounds(), the bounding box is incorrect.

Custom marker icon placement point

It seems like the marker icon is always placed by the center if you use a custom marker icon. I know there's a way to control the relative placement point for both Google maps API and IOS, so can we get that exposed via this API?

Custom markers not working on iOS

Hey again! I apologize if it seems like I'm opening an issue each time one closes - I appreciate your diligence!

I upgraded to 0.1.4+1 and added custom markers, but they only seem to show up on Android devices. On iOS devices, the default marker is still used. This was verified on an iPhone 8 Plus (simulator) and iPhone 6s Plus (physical).

Usage

var _markerIcon;

void _createMarkerFromImageAsset(BuildContext context) async {
    if(_markerIcon == null) {
      final ImageConfiguration imageConfiguration = createLocalImageConfiguration(context);
      var _markerBitmapDescriptor = await BitmapDescriptor.fromAssetImage(
        imageConfiguration, constants.markerImagePath
      ).catchError(print);
      setState(() {
        _markerIcon = _markerBitmapDescriptor;
      });
    }
  }

In the build method:
_createMarkerFromImageAsset(context);

Called when a successful response from our API is obtained:

void _addMarkers() {
    Set<Marker> _m = {};
    for(Store store in stores) {
      _m.add(
        Marker(
          icon: _markerIcon,
          markerId: MarkerId('$storeId'),
          position: LatLng(
            store.latitude, store.longitude
          ),
          consumeTapEvents: true,
          onTap: () => _toStoreDetails(store),
        ),
      );
    }
    setState(() {
      _markers = _m;
    });
}

Thanks!

Unable to build app on dev channel

I am trying to switch over from using the google maps plugin to this one and I am unable to run my app after adding this plugin.

Here is the output when running the app on my iPhone:

Xcode's output:
↳
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:117:48: error: 'UIButtonType' has been renamed to 'UIButton.ButtonType'
               let locationButton = UIButton(type: UIButtonType.custom) as UIButton
                                                   ^~~~~~~~~~~~
                                                   UIButton.ButtonType
    UIKit.UIButtonType:2:18: note: 'UIButtonType' was obsoleted in Swift 4.2
    public typealias UIButtonType = UIButton.ButtonType
                     ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:194:64: error: 'MKMapPointForCoordinate' has been replaced by 'MKMapPoint.init(_:)'
                        let distance: Float = Float(distanceOf(pt: MKMapPointForCoordinate(coord), toPoly: overlay as! MKPolyline))
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~
                                                                   MKMapPoint
    MapKit.MKMapPointForCoordinate:3:13: note: 'MKMapPointForCoordinate' was obsoleted in Swift 3
    public func MKMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:249:29: error: 'MKMapPointMake' is unavailable in Swift
                    ptClosest = MKMapPointMake(ptA.x + u * xDelta, ptA.y + u * yDelta)
                                ^~~~~~~~~~~~~~
    MapKit.MKMapPointMake:2:13: note: 'MKMapPointMake' has been explicitly marked unavailable here
    public func MKMapPointMake(_ x: Double, _ y: Double) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:252:38: error: 'MKMetersBetweenMapPoints' has been replaced by instance method 'MKMapPoint.distance(to:)'
                distance = min(distance, MKMetersBetweenMapPoints(ptClosest, pt))
                                         ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
                                         ptClosest.distance                  to:
    MapKit.MKMetersBetweenMapPoints:3:13: note: 'MKMetersBetweenMapPoints' was obsoleted in Swift 3
    public func MKMetersBetweenMapPoints(_ a: MKMapPoint, _ b: MKMapPoint) -> CLLocationDistance
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:261:16: error: 'MKMetersBetweenMapPoints' has been replaced by instance method 'MKMapPoint.distance(to:)'
            return MKMetersBetweenMapPoints(MKMapPointForCoordinate(coordA), MKMapPointForCoordinate(coordB))
                   ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   MKMapPointForCoordinate(coordA).distance                  to:
    MapKit.MKMetersBetweenMapPoints:3:13: note: 'MKMetersBetweenMapPoints' was obsoleted in Swift 3
    public func MKMetersBetweenMapPoints(_ a: MKMapPoint, _ b: MKMapPoint) -> CLLocationDistance
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:261:41: error: 'MKMapPointForCoordinate' has been replaced by 'MKMapPoint.init(_:)'
            return MKMetersBetweenMapPoints(MKMapPointForCoordinate(coordA), MKMapPointForCoordinate(coordB))
                                            ^~~~~~~~~~~~~~~~~~~~~~~
                                            MKMapPoint
    MapKit.MKMapPointForCoordinate:3:13: note: 'MKMapPointForCoordinate' was obsoleted in Swift 3
    public func MKMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/FlutterMapView.swift:261:74: error: 'MKMapPointForCoordinate' has been replaced by 'MKMapPoint.init(_:)'
            return MKMetersBetweenMapPoints(MKMapPointForCoordinate(coordA), MKMapPointForCoordinate(coordB))
                                                                             ^~~~~~~~~~~~~~~~~~~~~~~
                                                                             MKMapPoint
    MapKit.MKMapPointForCoordinate:3:13: note: 'MKMapPointForCoordinate' was obsoleted in Swift 3
    public func MKMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/MapViewExtension.swift:142:22: error: 'MKCoordinateRegionMake' is unavailable in Swift
            let region = MKCoordinateRegionMake(centerCoordinate, span)
                         ^~~~~~~~~~~~~~~~~~~~~~
    MapKit.MKCoordinateRegionMake:2:13: note: 'MKCoordinateRegionMake' has been explicitly marked unavailable here
    public func MKCoordinateRegionMake(_ centerCoordinate: CLLocationCoordinate2D, _ span: MKCoordinateSpan) -> MKCoordinateRegion
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/MapViewExtension.swift:184:16: error: 'MKCoordinateSpanMake' is unavailable in Swift
            return MKCoordinateSpanMake(latitudeDelta, longitudeDelta)
                   ^~~~~~~~~~~~~~~~~~~~
    MapKit.MKCoordinateSpanMake:2:13: note: 'MKCoordinateSpanMake' has been explicitly marked unavailable here
    public func MKCoordinateSpanMake(_ latitudeDelta: CLLocationDegrees, _ longitudeDelta: CLLocationDegrees) -> MKCoordinateSpan
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/MapViewExtension.swift:210:24: error: 'MKMetersBetweenMapPoints' has been replaced by instance method 'MKMapPoint.distance(to:)'
            let distance = MKMetersBetweenMapPoints(MKMapPointForCoordinate(centerCoordinate), MKMapPointForCoordinate(topBottom))
                           ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           MKMapPointForCoordinate(centerCoordinate).distance                  to:
    MapKit.MKMetersBetweenMapPoints:3:13: note: 'MKMetersBetweenMapPoints' was obsoleted in Swift 3
    public func MKMetersBetweenMapPoints(_ a: MKMapPoint, _ b: MKMapPoint) -> CLLocationDistance
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/MapViewExtension.swift:210:49: error: 'MKMapPointForCoordinate' has been replaced by 'MKMapPoint.init(_:)'
            let distance = MKMetersBetweenMapPoints(MKMapPointForCoordinate(centerCoordinate), MKMapPointForCoordinate(topBottom))
                                                    ^~~~~~~~~~~~~~~~~~~~~~~
                                                    MKMapPoint
    MapKit.MKMapPointForCoordinate:3:13: note: 'MKMapPointForCoordinate' was obsoleted in Swift 3
    public func MKMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/MapViewExtension.swift:210:92: error: 'MKMapPointForCoordinate' has been replaced by 'MKMapPoint.init(_:)'
            let distance = MKMetersBetweenMapPoints(MKMapPointForCoordinate(centerCoordinate), MKMapPointForCoordinate(topBottom))
                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~
                                                                                               MKMapPoint
    MapKit.MKMapPointForCoordinate:3:13: note: 'MKMapPointForCoordinate' was obsoleted in Swift 3
    public func MKMapPointForCoordinate(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
                ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/PolylineController.swift:65:21: error: 'add' has been renamed to 'addOverlay(_:)'
                mapView.add(polyline)
                        ^~~
                        addOverlay
    MapKit.MKMapView:66:15: note: 'add' was obsoleted in Swift 4.2
        open func add(_ overlay: MKOverlay)
                  ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/PolylineController.swift:91:29: error: 'remove' has been renamed to 'removeOverlay(_:)'
                        mapView.remove(polyline)
                                ^~~~~~
                                removeOverlay
    MapKit.MKMapView:13:15: note: 'remove' was obsoleted in Swift 4.2
        open func remove(_ overlay: MKOverlay)
                  ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/PolylineController.swift:98:17: error: 'remove' has been renamed to 'removeOverlay(_:)'
            mapView.remove(oldPolyline)
                    ^~~~~~
                    removeOverlay
    MapKit.MKMapView:13:15: note: 'remove' was obsoleted in Swift 4.2
        open func remove(_ overlay: MKOverlay)
                  ^
    /Users/adithya/.pub-cache/hosted/pub.dartlang.org/apple_maps_flutter-0.0.6+1/ios/Classes/PolylineController.swift:99:17: error: 'add' has been renamed to 'addOverlay(_:)'
            mapView.add(newPolyline)
                    ^~~
                    addOverlay
    MapKit.MKMapView:66:15: note: 'add' was obsoleted in Swift 4.2
        open func add(_ overlay: MKOverlay)
                  ^
    Command MergeSwiftModule failed with a nonzero exit code
    note: Using new build system
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Error launching application on Adithya's iPhone XS Max.
Exited (sigterm)

Here is the output of flutter doctor:

[✓] Flutter (Channel dev, v1.12.16, on Mac OS X 10.14.6 18G103, locale en-SG)
    • Flutter version 1.12.16 at /Users/adithya/Development/flutter
    • Framework revision 37f9c54116 (6 days ago), 2019-11-27 11:33:38 -0800
    • Engine revision fad1b23c42
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/adithya/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B53
    • CocoaPods version 1.7.5

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.40.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.6.0

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.108
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Map keeps crashing my app on Android

This component keeps crashing my app all the time on Android. On IOS it is crash-free.

My app uses bottom navigation bar. When navigating by it, going back and forward between tabs, app crashed inexpectedly on a page that contains a Gooogle Maps map on Android by your component. It not consistant, sometimes it crashes, sometimes not, anyway it does it very often.

StackTrace:
E/AndroidRuntime(13799): FATAL EXCEPTION: GLThread 139
E/AndroidRuntime(13799): Process: com.x.y, PID: 13799
E/AndroidRuntime(13799): java.lang.NullPointerException: Attempt to get length of null array
E/AndroidRuntime(13799): at java.nio.ByteBufferAsIntBuffer.put(ByteBufferAsIntBuffer.java:122)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.i(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):2)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.d(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):3)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.d.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):2)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.ao.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):12)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.bz.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):29)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.bs.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):151)
E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.av.run(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):48)
D/OpenGLRenderer(13799): setSurface called with nullptr
D/OpenGLRenderer(13799): setSurface() destroyed EGLSurface
D/OpenGLRenderer(13799): destroyEglSurface
3
D/OpenGLRenderer(13799): setSurface called with nullptr
I/Process (13799): Sending signal. PID: 13799 SIG: 9
Lost connection to device.

I tried it on 2 physical devices, it happens on both of them:

  • SM A520F (mobile), Android 8.0.0 (API 26)
  • SM A525F (mobile), Android 12 (API 31)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-x64, locale hu-HU)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.68.1)
[✓] Connected device (5 available)
[✓] HTTP Host Availability

iOS Corner Radius

Attempting to clip using a border-radius does not work on iOS. I guess the only way to do so is by having the plugin expose the iOS's MKMapView.layer.cornerRadius as a property.

Card(
  margin: EdgeInsets.all(2.0),
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(4.0),
  ),
  clipBehavior: Clip.antiAlias,
  color: Colors.black.withOpacity(0.35),
  child: Container(
    height: 200,
    child: PlatformMap(
      initialCameraPosition: CameraPosition(
        target: const LatLng(47.6, 8.8796),
        zoom: 16.0,
      ),
      markers: Set<Marker>.of(
        [
          Marker(
            markerId: MarkerId('marker_1'),
            position: LatLng(47.6, 8.8796),
            consumeTapEvents: true,
            infoWindow: InfoWindow(
              title: 'PlatformMarker',
              snippet: "Hi I'm a Platform Marker",
            ),
            onTap: () {
              print("Marker tapped");
            },
          ),
        ],
      ),
      onTap: (location) => print('onTap: $location'),
      onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
      compassEnabled: true,
      onMapCreated: (controller) {
        Future.delayed(Duration(seconds: 2)).then(
          (_) {
            controller.animateCamera(
              CameraUpdate.newCameraPosition(
                const CameraPosition(
                  bearing: 270.0,
                  target: LatLng(51.5160895, -0.1294527),
                  tilt: 30.0,
                  zoom: 18,
                ),
              ),
            );
          },
        );
      },
    ),
  ),
);

onDragEnd not fired on apple maps

Describe the bug
On apple maps, onDragEnd is not fired. I tried consumeTapEvents true and false, no change.

To Reproduce

        Marker(
          markerId: MarkerId('marker_${e.uuid}'),
          position: e.position.latLng,
          draggable: true,
          onDragEnd: _mapTap,
          // consumeTapEvents: true,
        ),
  1. hold down marker
  2. move it around
  3. let go
  4. event is not fired

Expected behavior
_mapTap should be called but isnt

Screenshots

Smartphone (please complete the following information):

  • Device: iPhone 12 pro
  • Version 1.0.2

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.4 20F71 darwin-x64, locale en-US)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.

[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.60.1)
[✓] Connected device (2 available)
! Error: i is busy: Copying cache files from device. Xcode will continue when i is finished. (code -10)

! Doctor found issues in 2 categories.

[IOS] tap handling lost for map after displaying BottomSheet

Adding a bottomSheet (or FAB or, in some cases, Overlay) over Map will permit just one more onTap event on the map and then that's it, no more calls to onTap method seem to occur. Here's a modification of the example that exhibits behavior:

import 'package:flutter/material.dart';

import 'package:platform_maps_flutter/platform_maps_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
//        width: 300,
//        height: 300,
        child: PlatformMap(
          initialCameraPosition: CameraPosition(
            target: const LatLng(47.6, 8.8796),
            zoom: 16.0,
          ),
          markers: Set<Marker>.of(
            [
              Marker(
                markerId: MarkerId('marker_1'),
                position: LatLng(47.6, 8.8796),
                consumeTapEvents: true,
                infoWindow: InfoWindow(
                  title: 'PlatformMarker',
                  snippet: "Hi I'm a Platform Marker",
                ),
                onTap: () {
                  setState(() {
                    showModalBottomSheet(context: context, builder: (context) {
                      return Container(
                        height: 200,
                        color: Colors.amber,
                        child: Center(
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            mainAxisSize: MainAxisSize.min,
                            children: <Widget>[
                              const Text('BottomSheet'),
                              RaisedButton(
                                child: const Text('Close BottomSheet'),
                                onPressed: () => Navigator.pop(context),
                              )
                            ],
                          ),
                        ),
                      );
                    });
                  });
                  print("Marker tapped");
                },
              ),
            ],
          ),
          mapType: MapType.satellite,
          onTap: (location) => print('onTap: $location'),
          onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
          compassEnabled: true,
          onMapCreated: (controller) {
//            Future.delayed(Duration(seconds: 2)).then(
//              (_) {
//                controller.animateCamera(
//                  CameraUpdate.newCameraPosition(
//                    const CameraPosition(
//                      bearing: 270.0,
//                      target: LatLng(51.5160895, -0.1294527),
//                      tilt: 30.0,
//                      zoom: 18,
//                    ),
//                  ),
//                );
//                controller
//                    .getVisibleRegion()
//                    .then((bounds) => print("bounds: ${bounds.toString()}"));
//              },
//            );
          },
        ),
      ),
    );
  }
}
```
`

Markers zIndex

Could there be a way to handle iOS zIndex Marker on map?

I've already tried reordering the markers array and then converting again to set. But the order is always defined differently.

Thanks a lot!

Unable to clear polylines set for map (worked previously)

Describe the bug
Calling the clear method on map.polylines throws "Unhandled Exception: Unsupported operation: Cannot change an unmodifiable set"

To Reproduce
Steps to reproduce the behavior:

  1. Just add a clear() call somewhere, though may need to add a few polylines if you don't have them in the sample.

Expected behavior
the set should be mutable and the clear should remove all displayed polylines.

Screenshots
n/a.

Smartphone (please complete the following information):

  • Device: Iphone simulator (any)
  • Version [e.g. 22]

flutter doctor
/Volumes/devstuff/Developer/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.5.1, on macOS 11.6 20G165 darwin-x64, locale en-US)
• Flutter version 2.5.1 at /Volumes/devstuff/Developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ffb2ecea52 (7 weeks ago), 2021-09-17 15:26:33 -0400
• Engine revision b3af521a05
• Dart version 2.14.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Volumes/devstuff/Android/sdk/
• Platform android-29, build-tools 29.0.3
• Java binary at: /Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 13.0.1+9)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
• CocoaPods version 1.10.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Android Studio (version 2020.3)
• Android Studio at /Volumes/Macintosh HD/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.60.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0

[✓] Connected device (3 available)
• iPhone 8 (mobile) • B094B1C2-EBDB-404C-A35A-58F6931095AC • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• iPhone 13 Pro (mobile) • 38883115-5DA6-4341-A3DE-5C06313A80B0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

PlatformException(error, Attempt to invoke virtual method 'float java.lang.Number.floatValue()' on a null object reference, null)

Hello!

After upgrading to 0.1.4, I am receiving a platform exception when the view is created. It appears to be Android only. Here is the stacktrace:

E/MethodChannel#flutter/platform_views( 7589): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:87)
E/MethodChannel#flutter/platform_views( 7589): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:51)
E/MethodChannel#flutter/platform_views( 7589): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#flutter/platform_views( 7589): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#flutter/platform_views( 7589): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/MethodChannel#flutter/platform_views( 7589): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/platform_views( 7589): at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#flutter/platform_views( 7589): at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#flutter/platform_views( 7589): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/MethodChannel#flutter/platform_views( 7589): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views( 7589): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/MethodChannel#flutter/platform_views( 7589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/flutter ( 7589): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'float java.lang.Number.floatValue()' on a null object reference, null)
E/flutter ( 7589): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:569
E/flutter ( 7589): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:316
E/flutter ( 7589):
E/flutter ( 7589): #2 AndroidViewController._create
package:flutter/…/services/platform_views.dart:640
E/flutter ( 7589):
E/flutter ( 7589): #3 AndroidViewController.setSize
package:flutter/…/services/platform_views.dart:557
E/flutter ( 7589):
E/flutter ( 7589): #4 RenderAndroidView._sizePlatformView
package:flutter/…/rendering/platform_view.dart:174
E/flutter ( 7589):
E/flutter ( 7589): #5 RenderAndroidView.performResize
package:flutter/…/rendering/platform_view.dart:155
E/flutter ( 7589): #6 RenderObject.layout
package:flutter/…/rendering/object.dart:1686
E/flutter ( 7589): #7 RenderStack.performLayout
package:flutter/…/rendering/stack.dart:549
E/flutter ( 7589): #8 RenderObject.layout
package:flutter/…/rendering/object.dart:1701
E/flutter ( 7589): #9 MultiChildLayoutDelegate.layoutChild
package:flutter/…/rendering/custom_layout.dart:142
E/flutter ( 7589): #10 _ScaffoldLayout.performLayout
package:flutter/…/material/scaffold.dart:444
E/flutter ( 7589): #11 MultiChildLayoutDelegate._callPerformLayout
package:flutter/…/rendering/custom_layout.dart:212
E/flutter ( 7589): #12 RenderCustomMultiChildLayoutBox.performLayout
package:flutter/…/rendering/custom_layout.dart:356
E/flutter ( 7589): #13 RenderObject.layout
package:flutter/…/rendering/object.dart:1701
E/flutter ( 7589): #14 RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 7589): #15 RenderObject.layout
package:flutter/…/rendering/object.dart:17

Thanks!

BitmapDescriptor.fromBytes

Hi,

I currently use custom marker images generated at runtime with the google map plugin from the BitmapDescriptor.fromBytes method.

Is there any blocking api on the Apple side ? If not, I could I help implement this for Apple maps.

Scroll lock when calling set state on ios apple maps

First of all really nice package. When using your package and calling setstate to update the markers or changing a tab the map will lock and i can’t move until i restart the app. This problem is only on ios with apple maps flutter.

Programmatically open an infoWindow

Is there a programmatic way to open the infoWindow? I'd like to have it open when the view is first displayed without having to tap on the icon.

Hashcode for Marker and MarkerId

As PlatformMap will receive parameter of markers with type Set, is good to have the hashCode that like google.Marker or apple.Annontation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.