开发者

i want to draw circle around my current location excatly 1 kilometers readius

hi friends i want to draw circle around my current location exactly 1 kilometer radius so wat can i do.....i able to draw circle but how to开发者_Go百科 put radius so it becomes exactly one kilometer..


At a high level:

  1. Get the bounding coordinates of your current map view.
  2. Use your coordinates to compute the distance either horizontally or vertically across your map. Convert your distance to meters, if necessary.
  3. Divide your distance in meters by the horizontal or vertical resolution (in pixels) of your map view. This gives you the number of meters per pixel at your current zoom level.
  4. Evaluate 1000 / <meters per pixel> to determine the number of pixels in 1 kilometer at the current zoom level. This is the radius of your circle.
  5. Draw your circle using the radius you got in step 4.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜