Google Map Marker Selection
I have an application which schedules jobs to engineers. The application uses the Google Maps JavaScript API to display markers showing job locations and the number of jobs at that location – see figure 1. What I’d like to be able to do is draw a box around a collection of markers and display the sum of all jobs.
How would I draw a box around the markers and then get a list of the selected markers? All of the jobs are held in an array with a ‘开发者_如何学运维marker’ property used by Google Maps.
Figure 1:
http://img442.imageshack.us/img442/2198/figure1.jpg
You can use polygons for drawing a box and having lat/lng values calculate your markers at box area. See more info about polygons here
Try fiddling with the example here.
精彩评论