Search code examples
javascriptvariablesgoogle-fusion-tables

I need help finding the 20 closest neighbors to the center a fusion layer


I have project in which I am trying to display the 20 closest people in a fusion table to the current center of map with the click of a button. I currently have the the lat and long as a static number, need that to change based on the maps current center. A link for what I currently have is http://www.mappingcenter.org/little_flock/littleflock.html>.

I am new to js and I truly am puzzled.


Solution

  • the getCenter()-method returns the center of a google.maps.Map-instance:

    orderBy:'ST_DISTANCE(geo_latitude, LATLNG('+map.getCenter().lat()+','+map.getCenter().lng()+'))'