Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
390
Google Map as TargetURL Centers Wrong Within Frame
posted

Can anyone advise me how to make a Google Map center properly within the frame of an Infragistics WebTab? Here's an example ...

http://www.peterklein.net/  (navigate: Photography > Places > NYC > Map)

showing how the map centers relative to the browser and not the WebTab. I found a couple of links discussing what I think are the same problem ...

http://forums.asp.net/t/1207085.aspx
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/2710b15f3d76ec2/67413d33e7fd0e74?tvc=2&q=asp.net

yet I confess I don't fully understand the javascript scenarios discussed. I'll post below the html from my Google Map page which is generated by an export from the program RoboGEO.

Thanks if anyone has advice about this.

Map page code ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>NYCMap</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="description" content="NYCMap - powered by Google Maps" />

<meta name="generator" content="RoboGEO v5.4" />

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAewLjz_kmTwF6agx5mipVJRSX99LV8rw0h8bwsLJz1iwYdESyThT3MJoRe6a83D6FfW7R20octwUtuw" type="text/javascript"></script>

<style type="text/css">

html, body, #map

{

width: 100%;

height: 100%;

}

body

{

margin-top: 0px;

margin-right: 0px;

margin-left: 0px;

margin-bottom: 0px;

font-family: Verdana, Arial, sans-serif;

font-weight: normal;

font-size: 11px;

}

#infotitle

{

text-align: center;

font-weight: bold;

padding-bottom: 10px;

font-size: 12px;

color: #CC0000;

}

#infodesc

{

float: left;

padding-right: 5px;

width: 180px;

}

#infoimg

{

text-align: center;

}

</style>

</head>

<body onunload="GUnload()">

<div id="map"></div>

<script type="text/javascript">

//<![CDATA[

// check for compatibility

if (GBrowserIsCompatible()) {

// call the info window opener for the given index

function makeOpenerCaller(i) {return function() { showMarkerInfo(i); };

}

// open an info window

function showMarkerInfo(i) {

markers[i].openInfoWindowHtml(infoHtmls[i]);

}

// create the map

var map = new GMap2(document.getElementById("map"));

map.addControl(new GLargeMapControl());

map.addControl(new GMapTypeControl());

map.addMapType(G_PHYSICAL_MAP);

map.addControl(
new GScaleControl());

map.addControl(new GOverviewMapControl());

map.setCenter(new GLatLng(40.782348125, -73.9688675), 11, G_NORMAL_MAP);

// add the markers

var request = GXmlHttp.create();

request.open("GET", "map.xml", true);

request.onreadystatechange = function() {

if (request.readyState == 4) {

var xmlDoc = request.responseXML;var markerElements = xmlDoc.getElementsByTagName("marker");

markerElementsLen = markerElements.length;

photos = new Array(markerElements.length);

markers = new Array(markerElements.length);

infoHtmls = new Array(markerElements.length);

for (var i = 0; i < markerElements.length; ++i) {

photos[i] = new GLatLng(parseFloat(markerElements[i].getAttribute("lat")), parseFloat(markerElements[i].getAttribute("lng")));

markers[i] = new GMarker(photos[i],{title:markerElements[i].getAttribute("title")});infoHtmls[i] = markerElements[i].getAttribute("html")

map.addOverlay(markers[i]);

GEvent.addListener(markers[i],
'click',makeOpenerCaller(i));

}

}

}

request.send(
null);

}

else {

document.getElementById("map").innerHTML = "Your web browser is not compatible with this website."

}

//]]>

</script>

</body>

</html>

 

Parents
No Data
Reply Children
No Data