I have the table having following columns
1. officeName 2. latitude 3. longitude
where latitude and longitude are numbers like 40.23568, -8325645
I have placed a google map on the page. The portion of the map which is seen at a time is called the viewport. so I want only those offices which are within the current viewport.
and i am trying the following code to solve the problem:
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var lngSpan = northEast.lng() - southWest.lng();
var latSpan = northEast.lat() - southWest.lat();
so whenever i make a move or zoom in or out the map, the viewport changes and so the respective offices also needs to be shown.