开发者

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

开发者 https://www.devze.com 2023-02-24 12:31 出处:网络
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.

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

精彩评论

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