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