如何在颤动中的当前位置创建圆圈 [英] How to create circle on current location in flutter

查看:22
本文介绍了如何在颤动中的当前位置创建圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做颤振项目.我必须在谷歌地图上的当前位置上画一个圆圈.有人知道吗.

I am working on flutter project.On which I have to draw one circle on my current location on google map.Does any one have idea.

我想要这样的flutter

提前致谢.

推荐答案

这个功能现在在 google_maps_flutter 包中可用:

This functionality is now available in the google_maps_flutter package:

https://pub.dev/documentation/google_maps_flutter_platform_interface/latest/google_maps_flutter_platform_interface/Circle-class.html

部分示例:

Set<Circle> circles = Set.from([Circle(
    circleId: CircleId(id),
    center: LatLng(latitude, longitude),
    radius: 4000,
)]);

GoogleMap(
    mapType: MapType.normal,
    myLocationEnabled: true,
    myLocationButtonEnabled: true,
    initialCameraPosition: initialMapLocation,
    onMapCreated: (GoogleMapController controller) {
      _controller.complete(controller);
    },
    onCameraMove: null,
    circles: circles,
  );

这篇关于如何在颤动中的当前位置创建圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆