简体   繁体   English

Android- Google Map v2绘制圆圈

[英]Android- Google map v2 Draw circle

Google, on Feb 26, released Circle as an overlay type: Google在2月26日发布了Circle作为叠加层类型:

https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Circle https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Circle

But how do I update to the new release of Google Map V2? 但是,如何更新到新版本的Google Map V2? When will it be available in Android SDK Manager? 什么时候可以在Android SDK Manager中使用? I have the previous Google Map V2 library within "Google Play Services" (Rev. 5) which does NOT include Circle class 我在“ Google Play服务”(修订版5)中拥有以前的Google Map V2库,其中不包含Circle

To update Google MAP V2: 更新 Google MAP V2:

Open Android SDK Manager -> Go to Extras -> Check for the update of Google Play Service . 打开Android SDK Manager->转到其他->检查Google Play服务的更新。 if it doesn't shows the update available , then go to Packages->Reload . 如果没有显示可用更新 ,请转到Packages-> Reload update the google play service to Revision 5 . 将Google Play服务更新到修订版5

After that remove the old Google Play Service Library project from Eclipse Workspace. 之后,从Eclipse Workspace中删除旧的Google Play服务库项目。 import it again. 再次导入。 add this library project in your current project. 在当前项目中添加该库项目。 now u will have the Circle class available under com.google.android.gms.maps.model package. 现在,您将在com.google.android.gms.maps.model包下提供Circle类。 and you can use that to add circle in your map. 您可以使用它在地图中添加圆圈。

To Add Circle : 要添加圈子

mMap.addCircle(new CircleOptions()
        .center(new LatLng(location.getLatitude(), location.getLongitude()))
        .radius(100)
        .strokeColor(Color.RED)
        .fillColor(Color.BLUE));

And for your information, this is Release note for changes of February 2013 . 谨此通知您,这是2013年2月变更的发行说明

EDIT : This is Release notes for June 2016. You can now make the circles clickable, which may be helpful if you want to do some action with circle. 编辑:这是2016年6月的发行说明。您现在可以使圆圈变为可点击状态,如果您想对圆圈进行一些操作,这可能会有所帮助。

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

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