This project is read-only.

Page hangs upon ajax postback.

Aug 30, 2009 at 10:44 PM

I have the map control working great on a page in my site, complete with markers generated at page_load. However, when I click a LinkButton that is inside another update panel that causes an ajax postback, the page hangs. I should also mention that I'm using Master Pages and the UpdatePanel that does the postback is in another ContentPlaceHolder. The "status bar" at the bottom of my browser says "Read maps.gstatic.com" and goes no further. Are there any known issues with the map control and separate update panels doing postbacks? At present, I can't debug in VS because of the localhost problem.

I am using the most current stable release of the map control. My web app is running in asp.net framework v3.5. My client browsers are Firefox and Safari.

 

Sep 1, 2009 at 2:24 AM

I was finally able to debug the js code in VS. Below is a block of js code that I got from VS debugger displayed in a tab labeled "Eval Code". The erring code is commented. VS says "a" is null. I added tabs for readability. Any help would be great.

 

function LA(a,b,c){
return
function(){
a({
name:b,
Status:{
code:c,
request:"geocode"
}
}
)
}
}

function MA(a,b){
return function(c){
a.zQ(c.name,c);
b(c)
}
}

Jn.g = function(a,b,c,d){
this
.ba=a||new In;
this.Va=new Ji(_mHost+"/maps/geo",document);
this.SB=this.ah=this.sc=j;
this.uH=b||j;
this.Ww=c||j;
this
.Vw=d||j
};

m=Jn.prototype;
m.Bv = function(a){
this.sc=a
};

m.GA = function(){
return this.sc
};

m.BE = function(a){
this.ah=a
};

m.Ez = function(){
return this.ah
};

m.li = function(a,b,c){
var d=b.Ca&&b.Ca()||""+b;
if(d&&u(d)){
var e=this.dM(d);
if(e)window.setTimeout(function(){c(e)}, 0);
else{
var g={};
g.output="json";
g.oe="utf-8";
if(a==1){
g.q=d;
if
(this.sc){
g.ll=this.sc.P().Ca();
g.spn=this.sc.rb().Ca()
}
if(this.ah)g.gl=this.ah
}
else
if(a==2)g.ll=d;
else if(a==3){
g.ll=b.P().Ca();
g.spn=b.rb().Ca()
}
g.key=this.uH||hg||j;
if(this.Ww||ig)g.client=this.Ww||ig;
if(this.Vw||jg)g.channel=this.Vw||jg;
if(kg)g.sensor=kg;
g.mapclient="jsapi";
if
(this.SB)g.hl=this.SB;
this.Va.send(g,MA(this,c),LA(c,b,500))
}
}
else window.setTimeout(LA(c,"",601),0)
};

m.Om = function(a,b){
this
.li(a.Ca?2:1,a,b) // <<<<<<<<< HERE IS WHERE I GET JS ERROR: "'Ca' is Null or not an object"
};

m.vK = function(a,b){
this.li(2,a,b)
};

m.Gr=function(a,b){
this.li(3,a,b)
};

m.ya=function(a,b){
this.Om(a,NA(1,b))
};

m.getAddress=function(a,b){
this.vK(a,NA(2,b))
};

function NA(a,b){
return
function(c){
var d=j;
if
(c&&c[al]&&c[al][bl]==200&&c.Placemark)
if(a==1){
var e=c.Placemark[0].Point.coordinates;
d=new K(e[1],e[0])
}
else if(a==2)
d=c.Placemark[0].address;
b(d)
}
}

m=Jn.prototype;

m.reset=function(){
this.ba&&this.ba.reset()
};

m.DE=function(a){
this
.ba=a
};

m.Gz=function(){
return
this.ba
};

m.zQ=function(a,b){
this.ba&&this.ba.put(a,b)
};

m.dM=function(a){
return this.ba?this.ba.get(a):j
};

T("api_gc",1,Jn);
T("api_gc");

 

 

 

Sep 1, 2009 at 2:57 AM

In case anyone else has this problem, I think I found the solution. Google Maps requires lat and long be specified for the map to load properly. I was specifying the lat and long in the Page_Load in my code-behind, but only when !Page.IsPostBack. So, the map was loading fine on initial page load, but experienced errors at partial postback because the lat and long were not being explicitly specified again. I moved the map initialization code so that it executes whether postback or not and it works like a charm!