Lin
Posts: 0
Joined: Wed Feb 18, 2015 2:56 am

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

My app uses the google map component to display current location. The geolocation service is invoked when the page loads and the map displays the current location marker correctly. When the refresh button is selected, the geolocation service is invoked again. This time, however, the marker appears for a fraction of a second then disappears. The error console displays the following message:

[Error] TypeError: null is not an object (evaluating 't[gF]')
jca (undefined, line 34)
(anonymous function)
instrumentedCode (target-script-min.js, line 3439)

Does anyone know what could be causing this error?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

Hello Lin,

Could you please share screenshots with detail information - what events are fired at your components(page and refresh button), parameters of your service, mapping?

Lin
Posts: 0
Joined: Wed Feb 18, 2015 2:56 am

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

Hi Evgene,

Thanks for the quick reply. Attached are screenshots from my app. Let me know if this is the information you need.

Image
Image Image Image

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

It could be that the map is in the process of loading, and the refresh method is being called. Just to narrow in, you can add a small interval using setTimeout, to check if that helps. If yes then you know exactly what to do :)

Lin
Posts: 0
Joined: Wed Feb 18, 2015 2:56 am

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

Thanks for the suggestion M&M. I'm new to programming. I gather that you are recommending I use the settimeout function. I found an example (below), but I'm not quite sure how to use it.

setTimeout(function() {
// Do something after 5 seconds
}, 5000);

Could you be more specific?

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

I get the following error when trying to refresh a google map: TypeError: null is not an object (evaluating 't[gF]')

yup. What you can do is to refresh the map / clear the address after a slight delay - say 100 - 500 ms.

In short your 3 lines that do the refreshing - use them in the place of "// Do something after 5 seconds"

But ya 5 seconds is too long, perhaps a 100ms to 500ms value will be appropriate.

Return to “Issues”