Put movable circle over google map and get center position and radius
I would like to put in my map on site something similar like on this site
When choose Personalize Your Search, I开发者_高级运维 need to get gps of circle center and zoom and radius.
How could I achieve this?
All help is appreciated.
Why don't you add a draggable marker to you map?And the icon of the marker can be an icon with a circle around it.
If you use the Google Maps API V3, then you have the google.maps.Circle class. The circle gives you all the information you are requesting through it's methods:
- getRadius()
- getCenter()
It also has events, so that you can listen to mouse clicks on your map and move the circle to that click.
Thats how you can make a draggable element using Jquery, but not quite sure about getting a GPS location. http://jqueryui.com/demos/draggable/
You can then find out the latitude, longitude when mouse moves over map. These lat and long info with help you to geocode the address and you can play around once you have current longitude and latitude information.
精彩评论