简体   繁体   English

Flutter Google Maps 插件在 iOS 上无法正常工作

[英]Flutter Google Maps plugin is not working properly on iOS

I'm using this Google Maps plugin: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter我正在使用这个谷歌地图插件: https : //github.com/flutter/plugins/tree/master/packages/google_maps_flutter

On Android it's working fine, but markers on iOS are not working properly.在 Android 上它工作正常,但在 iOS 上的标记无法正常工作。 When a marker is tapped on iOS platform, camera moves a little bit and displays an InfoText, but my flutter code is the same for both platforms.当在 iOS 平台上点击标记时,相机会移动一点并显示一个 InfoText,但我的颤振代码在两个平台上是相同的。 I put breakpoints on methods: onMarkerTapped() and onInfoWindowTapped() and there are not called on iOS devices (GoogleMapController.dart).我在方法上设置了断点: onMarkerTapped()onInfoWindowTapped()并且在 iOS 设备上没有调用 (GoogleMapController.dart)。

Also the marker icon providing a BitmapDescriptor is not working on iOS too, but it's not as important as all I've mentioned before.此外,提供 BitmapDescriptor 的标记图标也不适用于 iOS,但它不像我之前提到的那么重要。

- Someone knows how to call this methods on iOS? - 有人知道如何在 iOS 上调用这个方法吗?

Please, I need to fix this on iOS platform and I don't know how.拜托,我需要在 iOS 平台上解决这个问题,但我不知道如何解决。

Thanks!谢谢!

From the project readme (emphasis mine):从项目自述文件(强调我的):

This plugin provides an unpublished preview of the Flutter API for Google Maps:这个插件为 Google Maps 提供了 Flutter API 的未发布预览:

Dart APIs for controlling and interacting with a GoogleMap view from Flutter code are still being consolidated and expanded.用于从 Flutter 代码控制 GoogleMap 视图并与之交互的 Dart API 仍在整合和扩展中。 The intention is to grow current coverage into a complete offering.目的是将当前的覆盖范围扩大到一个完整的产品。 Issues and pull requests aimed to help us prioritize and speed up this effort are very welcome.非常欢迎旨在帮助我们优先考虑和加快这项工作的问题和拉取请求。 Currently the plugin only supports Android as it embeds a platform view in the Flutter hierarchy which is currently only supported for Android (tracking issue).目前该插件仅支持 Android,因为它在 Flutter 层次结构中嵌入了平台视图,目前仅支持 Android(跟踪问题)。

iOS is not yet supported for this plugin.此插件尚不支持 iOS。 Likely you will just have to wait until the plugin is out of preview - or at least closer to release when it is more feature complete.可能您只需要等到插件结束预览 - 或者至少在功能更完整时更接近发布。 I wouldn't recommend using such a preview in production.我不建议在生产中使用这样的预览。

One alternative I have found some success with is https://pub.dartlang.org/packages/flutter_map It has worked ok for me, but does have some hiccups with performance at times.我发现一些成功的替代方法是https://pub.dartlang.org/packages/flutter_map它对我来说效果很好,但有时确实会出现一些性能问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM