Markers not placed correctly from the far zoom
When you first open my page the pointers appear in the ocean or far
above where they should be. When you zoom in close they are placed
correctly. I'm not sure if I have this set up incorrectly. Below is
my code. Let me know if you need to see my xml for this. Thanks!
<!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"xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>Fleishman Hillard Offices</title>
<script
src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAeZEgfl4pAegnMIYtaQSSmhSWvvNvrs01A_eiSJCtwHgSCrWjJhTszh6AeC8H6MWJHge4_G0FqQBg7g"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load(){
var map = new GMap(document.getElementById("map"));
var point = new GPoint(-1.544767 , 32.396);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(point, 15);
var baseIcon = new GIcon();
baseIcon.shadow =
"http://labs.google.com/ridefinder/images/mm_20_yellow.png";
baseIcon.iconSize = new GSize(10, 12);
baseIcon.shadowSize = new GSize(10, 12);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
baseIcon.infoShadowAnchor = new GPoint(18, 25);
function createMarker(point, iconname, info) {
var icon = new GIcon(baseIcon);
icon.image = iconname.getAttribute("image");
var marker = new GMarker(point, icon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowXslt(info,
"http://stage.fleishman.com/thesource/map.xsl");
});
return marker;
}
var request = GXmlHttp.create();
request.open("GET", "http://stage.fleishman.com/thesource/map.xml",
true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = request.responseXML;
var points = xmlDoc.documentElement.getElementsByTagName("point");
var icons = xmlDoc.documentElement.getElementsByTagName("icon");
var info = xmlDoc.documentElement.getElementsByTagName("info");
for (var i = 0; i < points.length; i++) {
var point = new
GPoint(parseFloat(points[i].getAttribute("lng")),
parseFloat(points[i].getAttribute("lat")));
var marker = createMarker(point, icons[i], info[i]);
map.addOverlay(marker);
}
}
}
request.send(null);
}
//]]>
</script>
</head>
<body onload="load()">
<div id="map" style="width: 975px; height: 550px"></div>
</body>
</html>
0 Comments:
Yorum Gönder
<< Home