javascript - Bing Map v7, Direct call vs Ajax Call. Delay on Callback Function -


i'm adding bing map page using call:

var geocoderequest = "http://dev.virtualearth.net/rest/v1/locations?query=" + encodeuri(addressstring) + "&output=json&jsonp=geocodecallback&key=" + credentials; 

it's working fine when used directly in page javascript tag. want reuse in different pages i'm trying extract partial view , call on demand in different pages using ajax call.

here controller

 public actionresult showmap(string address)         {               maphandlermodel model = new thelist20site.maphandlermodel { title = "address", address = address, originalheight = 400, originalwidth = 500, smallheight = 0, smallwidth = 500, speed = 500 };   return partialview("prtmap", model);         } 

and call happen through ajax method:

$.ajax({                 url: "/project/showmap",     type: "post",                  data: { address: addressstring },                  success: function (data) {       $("#divmapplaceholder").html(data);        } }); 

while i'm using ajax call there significant delay in calling "geocodecallback" function map pointg after refreshing map (not page) working fine!

one more thing ... if call partial view using htmlhelper partial (like code below) working fine...but still need called on demand (like on completing form , etc.)

 @{                 @html.partial("prtmap", model)        } 

i don't know wrong...

thank you.

one thing might want @ doing speed things perform geocode on server side. right in showmap function. can find information on how use bing maps rest services in .net here: http://msdn.microsoft.com/en-us/library/jj819168.aspx


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -