Draw radius around a point in Google map

前端 未结 6 2132
悲哀的现实
悲哀的现实 2020-12-02 03:39

I\'m using the Google Maps API and have added markers. Now I want to add a 10 mile radius around each marker, meaning a circle that behaves appropriately while zooming. I ha

6条回答
  •  萌比男神i
    2020-12-02 04:28

    I've had this problem in the past, so I bookmarked this discussion.

    To summarize it, you can:

    1. Take a look at this circle filter's source code and figure out how to incorporate it into your project.
    2. Draw a GPolygon with enough points to simulate a circle.
    3. Generate a KML file by modifying http://www.nearby.org.uk/google/circle.kml.php?radius=30miles&lat=40.173&long=-105.1024 and then importing it. In Google Maps, you can just paste the URI in the search box and it will display on the map. I'm not sure how you might do it using the API though.

提交回复
热议问题