google_maps_flutter_web : google 地图小部件的行为与移动版本不同(折线)

google_maps_flutter_web : the google maps widget doesn't behave as the mobile version (polyline)

我目前正在开发 Flutter 应用程序 mobile/web,我遇到了“google_maps_flutter”包的问题。我的目标是显示一张地图,其中绘制了多段线。

Here is a screenshot of the Android version which is working as expected

Now, we have the web version which displays the Polyline as a straight line heading to the north

这是我的 GoogleMap 小部件的代码示例:

GoogleMap(
                  gestureRecognizers: Set()
                    ..add(Factory<PanGestureRecognizer>(
                        () => PanGestureRecognizer())),
                  initialCameraPosition: CameraPosition(
                      target: polylines.first.points.first, zoom: 20.0),
                  mapType: MapType.hybrid,
                  polylines: polylines,
                  compassEnabled: false,
                  tiltGesturesEnabled: false),
            ),

这是我正在使用的 google 地图包:

  google_maps_flutter: ^2.0.6
  google_maps_flutter_web: ^0.3.0+2

提前感谢您的宝贵时间

找到了! 问题似乎出在网络中 package:flutter_polyline_points :: decodePolyline 方法的实现中:

https://github.com/Dammyololade/flutter_polyline_points/issues/40#issuecomment-751765055