I’ve got script (a) that is a javascript script in which I’ve go this function:
function csf_viewport_bounds() {
var bounds = map.getBounds();
var ne = bounds.getNorthEast();
var sw = bounds.getSouthWest();
var maxLat = ne.lat();
var maxLong = ne.lng();
var minLat = sw.lat();
var minLong = sw.lng();
var the_maps_bounds = [maxLat, maxLong, minLat, minLong];
return(the_maps_bounds);
}
I’ve also got jQuery script (b). It has a line that calls the function in (a):
google.maps.event.addListener(map, 'tilesloaded', csf_viewport_bounds);
How can I access the what is returned by (a), the_maps_bounds, in script (b)?
Thank you.
I’m presuming you want to do something after
tilesloadedthat involvesthe_maps_boundsin which case you would do something like: