开发者

Android Google Map filled circle

开发者 https://www.devze.com 2023-03-21 10:24 出处:网络
I am trying to make a map overlay that just shows a solid circle from the map center who\'s radius is a range in meters.

I am trying to make a map overlay that just shows a solid circle from the map center who's radius is a range in meters.

I can't figure out how to calculate the circle's radius. I can get the map center, but I haven't had any luck figuring out how to convert meters into 开发者_StackOverflow中文版the proper units for the circle's radius.

Thanks for any help.


I've got no experience of doing this in a gMaps context, but the MapView class (whose getProjection() I'm assuming you've used to work out where your point is on the screen) has getLatitudeSpan() and getLongitudeSpan() which you can use against the screen res to calculate the pixel-radius of your circle.

0

精彩评论

暂无评论...
验证码 换一张
取 消