问题
I need to do a search for markers that are within a circle using as parameters the radius and position of the center of the circle. Someone can help me on how serious this search.
回答1:
Concept:
- make an array of the markers you want to search
- iterate through the array of markers calculating the distance between each marker and the center point using the geometry library computeDistanceBetween() function
- compare that distance to the radius of the circle, if it is less than the radius, the marker is inside the circle, otherwise it is outside the circle.
example (with center point from geocoded address)
来源:https://stackoverflow.com/questions/11704148/search-inside-circle-markers