views:

279

answers:

1

rather than using a textnode to show content im trying to figure out how to load a webpage with params into the google map.

here is the code im working with

if (GBrowserIsCompatible()) { 
    var map = document.getElementById("map_canvas"); 
    var m = new GMap2(map);



m.setCenter(new GLatLng(36.158887, -86.782056), 13); 
m.openInfoWindow(m.getCenter(), 
document.createTextNode("This is our business.")); 


m.setMapType(G_SATELLITE_MAP); 
var c = new GMapTypeControl(); 
m.addControl(c);
m.addControl(new GLargeMapControl());

}

my lack of javascript, how would i load a webpages content rather than using the createtextnode with text?

thanks

+2  A: 

Try creating a IFRAME:

var iframe = document.createElement('iframe');

And setting the source:

iframe.src = 'http://www.google.com/?with&whatever&parameters';

And using that instead of the text node:

m.openInfoWindow(m.getCenter(), iframe);
Isaac Waller
sweet!! thanks that worked. love u man.
SarmenHB