Geocoder.geocode returns "ERROR" on a long running page.

201 views
Skip to first unread message

Jeff

unread,
Jul 13, 2010, 11:36:12 AM7/13/10
to Google Maps JavaScript API v3
I have a long running page that is used to display status items and a
map. The page itself can be up for days, in a 24 hour period, it
might need to geocode an address 2 or 3 times.

At some point, the status of a geocode request will be "ERROR" and
then no more geocode requests will work until the page it refreshed.

I have very similar code for V2 and V3 of the API, the V2 version runs
flawlessly for weeks on end. The V3 version fails after 24 to 36
hours. I have not been able to reproduce on demand, but it is fairly
reliable that within 24 to 36 hours there will be a failure. I have
been able to (just now) trap the situation in the debugger, and
nothing appears to be amiss. The code that I'm using is as follows:

I'm loading the api with: <script src="http://maps.google.com/maps/api/
js?sensor=false" type="text/javascript"></script>

Then in my event handler for when I need to move the map, I have the
following code:
if (window.console)
console.log("Doing Geocode now");
var coder = new google.maps.Geocoder();
coder.geocode({ address: result.Address }, function
(georesult, status) {
if (window.console)
console.log("Geocode result: %d", status);
if (status == google.maps.GeocoderStatus.OK) {
moveMap(georesult[0].geometry.location.lat(),
georesult[0].geometry.location.lng(),
georesult[0].geometry.location_type, result.AlarmID);
}
});

This runs/works as expected for hours and sometimes days on end, then
the returned status will be "ERROR" and then it's dead.
I suspect that there is some cached / global item that goes stale and
does not get refreshed until the page is refreshed.

Any thoughts on how to avoid / workaround / recover would be greatly
appreciated.


I do get the following error from IE, doubt it had anything to do with
this problem...
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/
4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; Tablet PC 2.0; Zune
4.0; .NET4.0C; .NET4.0E; OfficeLiveConnector.1.4; OfficeLivePatch.1.3;
InfoPath.2)
Timestamp: Tue, 13 Jul 2010 15:15:42 UTC


Message: Unspecified error.
Line: 25
Char: 517
Code: 0
URI: http://maps.gstatic.com/intl/en_us/mapfiles/api-3/1/6/main.js


Ben Appleton

unread,
Jul 13, 2010, 8:16:12 PM7/13/10
to google-map...@googlegroups.com
Your session expires after a day or so.  Can you reload the page once a day?



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Jeff

unread,
Jul 14, 2010, 10:53:53 AM7/14/10
to Google Maps JavaScript API v3
Hi Ben,

I was afraid of that. The app runs on an unattended display in a
public space.
I would prefer to avoid reloads if I can, as if it fails, you're dead
in the water.
With that said, I did add some code to reload the page in the event of
a result of "ERROR".

Is there a way to either keep a session alive or get a new one without
having to do the reload?

Thanks for your help,

Jeff
> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B unsub...@googlegroups.com>
> > .

Ben Appleton

unread,
Jul 14, 2010, 4:45:13 PM7/14/10
to google-map...@googlegroups.com

There isn't such a refresh service at present.  If you file an issue in the issue tracker, we'll see how popular it is and prrioritize it accordingly.

Thanks
Ben

> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages