Map Bounds Undefined Javascript -
i'm new javascript in general, , i'm setting map , need bounds of map set up. thing keep getting message i'm unable getnortheast() undefined value, meaning map.getbounds()
failed return map's bounds. however, documentation says:
returns lat/lng bounds of current viewport. if more 1 copy of world visible, bounds range in longitude -180 180 degrees inclusive. if map not yet initialized (i.e. maptype still null), or center , zoom have not been set result null or undefined.
the map's center , zoom defined, don't know wrong.
map = new google.maps.map(document.getelementbyid('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 }); var bounds = map.getbounds(); var origne = bounds.getnortheast(); var origsw = bounds.getsouthwest();