Google Map With Multiple Markers

484 views Asked by At

I am creating a search module for a website I have my own database along with the coordinates(lat,long). I plotted all the coordinates from the search result on google map, now the problem is that i want to show the marker more prominent or bigger that is nearest to the user among all other points. How can this be done, my website is in php. Thanks!

1

There are 1 answers

0
Alimentador On

First you'll have to get those LatLng from database, once the customer got you create the (invisible) markers, having done that, google has google.maps.geometry.spherical.computeDistanceBetween that returns the distance between two LatLng, the frist LatLng get from the geolocation, the second LatLng of the database, save the distance in an array and then recover the lowest value.

Look at this example Fiddle