Bonjour,

J'ai un problème, j'ai créé ma google map pour le site de l'entreprise où je travaille, la liste des markers se trouvent dans un fichier XML. cette liste ressort bien sur le site sous firefox mais pas sur IE ! Pourquoi ? (la page s'affiche dans une frame).

Voici le code de la page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html>
	<head>

 <script type="text/javascript">
<!--
function autofitIframe(id){ // v.1.0

if (!window.opera && !document.mimeType && document.all && document.getElementById){
parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px"
}
else if(document.getElementById) {
hauteur = this.document.body.scrollHeight + 0;
parent.document.getElementById(id).style.height=hauteur+"px"
}
} 
// -->
</script>	

	<style>
	
A:link {text-decoration: none; color: #003D88;}
A:visited {text-decoration: none; color: #003D88;} 
A:active {text-decoration: none; color: #000000; }
A:hover {text-decoration: none; color: #000000; }
	
	body { 
	
	font-family:Verdana;
	font-size:10px;
	}
	</style>

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

<body onload="autofitIframe('frame')">

		<table width="99%" height="100%" border=0 style="width:100%;height:100%">
			<tr>
				<td>
					<div id="map" style="width:100%;height:600px"></div>
				</td>
				<td width = 150 valign="top" style="text-decoration: underline; color: #4444ff;">
					<div id="sidebar" style="overflow:auto; height:600px;"></div>
				</td>
			</tr>
	</table>
		<script type="text/javascript">

    //<![CDATA[

		// If broser ok
		if (GBrowserIsCompatible()) 
		{

			// this variable will collect the html which will eventualkly be placed in the sidebar
			var sidebar_html = "";
    
			// arrays to hold copies of the markers and html used by the sidebar
			// because the function closure trick doesnt work there
			var gmarkers = [];
			var htmls = [];
			var i = 0;

			var gicons = new GIcon(G_DEFAULT_ICON, "bullet.png");
			gicons.iconSize=new GSize(16,16);
			gicons.shadowSize=new GSize(0,0);

			//**********************************************************************************************
			function createMarker(aPoint, aName, aTexte)
			{
		    
				var _Marker = new GMarker(aPoint, gicons);
			
				GEvent.addListener(_Marker, "click", function(){_Marker.openInfoWindowHtml(aTexte);});
		    
				// save the info we need to use later for the sidebar
				gmarkers[i] = _Marker; 
				htmls[i] = aTexte;
		    
				// add a line to the sidebar html
				sidebar_html += '<a href="javascript:myClick(' + i + ')">' + aName + '</a><br>';
				i++;
		        
				return _Marker;
		    
			} // End createMarker
   
			//**********************************************************************************************
			function myClick(i)
			{
				gmarkers[i].openInfoWindowHtml(htmls[i]);  
			}
			
			//**********************************************************************************************
			var map = new GMap2(document.getElementById("map"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(46.4295,6.2611), 13);
			
			// Read the data from example3.xml
			var request = GXmlHttp.create();
			request.open("GET", "Clients.xml", true);
			request.onreadystatechange = function() 
			{
			
				if (request.readyState == 4) 
				{
				
					var xmlDoc = request.responseXML;

					// obtain the array of markers and loop through it
					var markers = xmlDoc.documentElement.getElementsByTagName("marker");
				 
					for (var i = 0; i < markers.length; i++)
					{
					
						// obtain the attribues of each marker
						var lat = parseFloat(markers[i].getAttribute("lat"));
						var lng = parseFloat(markers[i].getAttribute("lng"));
						var point = new GLatLng(lat,lng);
						
						var logo = markers[i].getAttribute("logo");
						var name = markers[i].getAttribute("name");
						var Addr = markers[i].getAttribute("Addr");
						var Loca = markers[i].getAttribute("Loca");
						
						// create the marker
						var marker = createMarker(point, name, logo + '<br></br><br><b>' + name + '</b></br>' + '<br>' + Addr + '</br>'+ '<br>' + Loca + '</br>');
						map.addOverlay(marker);
						
					} // End for
				
					// put the assembled sidebar_html contents into the sidebar div
					document.getElementById("sidebar").innerHTML = sidebar_html;
			
				} // End if readyState = 4
				
			} // End onreadystatechange
			
			request.send(null);
			
		} // End if browser ok
			
		else 
		{
			alert("Votre browser est incompatible avec google map!");
		}
			
			//createMarker(map, 46.4295, 6.2611, '<b>Mega Informatique</b><br>Rte du Brgeaud 10b</br><br>1196 Gland</br>');
	
    //]]>
    
    </script>
	
	
    
  </body>
  
</html>


Je bute sur ce problème depuis un petit, please help Smiley ohwell [/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
Modifié par dudinsky (25 May 2007 - 10:24)