Page 1 of 3

Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Wed Jan 28, 2015 4:53 pm
by Joe Sharples

I'm receiving this error in the console.

Uncaught TypeError: Cannot read property 'getBounds' of null
Rba
(anonymous function)

What does it mean?


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Wed Jan 28, 2015 5:43 pm
by Joe Sharples

I deleted the map component on the page and now theres no error.

The map component is causing it.
I have a service mapping an 'address' field to the map and marker address.


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Wed Jan 28, 2015 9:49 pm
by Ihor Didevych

Hi Joe,

1) can provide at least screenshot with full stack trace ?
2) what service do you calling at that point ?


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Thu Jan 29, 2015 12:04 pm
by Joe Sharples

to isolate the problem in removed all existing events on page load/show.

The page name is NightInfo.

Image

Image


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Thu Jan 29, 2015 12:32 pm
by M&M

One of the possibilities could be that the map component has not finished loading. You want to move the REST call to a button click event or something first to isolate the event?

I dunno if this will help but what I did was to add a small delay in calling the REST API on my page show event...and so far things have been fine....

Here's the snippet just in case it'd help

code
// Change the map component name to match your's
var map;

function initialize() {
map = Apperyio("googlemap1").gmap;
if (!map)
{
setDelay();
}
else
{
restNearbyPlaces.execute();
}
}

function setDelay()
{
setTimeout(initialize, 50);
}

initialize();
/code


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Mon Feb 02, 2015 2:25 pm
by Joe Sharples

Hi M&M,

Thank you for your response, although I'm not sure which REST API you mean?
By REST API call do you mean the services that I have created under the pages data tab inside appery builder?
I still receive the error when these service haven't been executed.

or are you referring to the other rows under the network tab of chrome dev tools that are shown in my previous screenshot?


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Tue Feb 03, 2015 3:13 pm
by Joe Sharples

Any ideas?


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Tue Feb 03, 2015 4:36 pm
by Murali

have you used any external javascript libraries?


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Tue Feb 03, 2015 5:03 pm
by Lee Kraus

I am getting the same error


Uncaught TypeError: Cannot read property 'getBounds' of null

Posted: Tue Feb 03, 2015 5:09 pm
by Murali

Are you using the google map component as well?