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

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

问题描述

我正在从事flutter项目.在该项目上,我必须在Google地图上的当前位置绘制一个圆圈.任何人都有想法.

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.

我想像这样

谢谢.

推荐答案

此功能现已在google_maps_flutter软件包中提供:

This functionality is now available in the google_maps_flutter package:

https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/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天全站免登陆