javo | Bonjour,
j'ai un problème avec l'API google maps, la carte ne s'affiche pas sous IE8. Pourtant elle marche sous ff, opera et chrome, de plus elle est aux normes W3C (même si je sais que ça ne veut rien dire^^)
voici le lien: http://home.student.uu.se/reja2419/search.php
et le code de l'api:
Code :
- <script type="text/javascript">
- //<![CDATA[
- <!--
- function load() {
- if (GBrowserIsCompatible()) {
- var map = new GMap2(document.getElementById("map" ));
- map.addControl(new GSmallMapControl());
- map.addControl(new GMapTypeControl());
- var lat = "<?php echo $latitude; ?>";
- var lon = "<?php echo $longitude; ?>";
- var adresse = "<?php echo $city; echo $address;?>" ; // get the provided address from the search field
- var geocoder = new google.maps.ClientGeocoder(); // use Google Geocoder to transform address into coordinates
- geocoder.getLatLng(adresse, function (coord) { // create the point
- // Center the map on coordinates provided by Google after button SHOW:
- if(lat&&lon)
- map.setCenter(new GLatLng(lat, lon), 14);
- // after a SEARCH:
- else if (coord)
- map.setCenter((coord), 12);
- // Or default position if no address is entered:
- else map.setCenter(new GLatLng(62.3908358, 17.3069157), 4);
- });
- arrayLat = new Array(); // initializing the javascript array for latitude
- arrayLon = new Array(); // initializing the javascript array for longitude
- arraycompany = new Array();
- arrayid = new Array();
- arrayaddress = new Array();
- arraycity = new Array();
- arraytime = new Array();
- arrayunit = new Array();
- arrayprice = new Array();
- <?php
- foreach( $arrayLat as $valueLat ){ // for each line of the array where there is a value
- print "arrayLat.push(\"$valueLat\" );"; // This line updates the script array with new entry
- }
- foreach( $arrayLon as $valueLon ){
- print "arrayLon.push(\"$valueLon\" );";
- }
- foreach( $arrayid as $valueid ){
- print "arrayid.push(\"$valueid\" );";
- }
- foreach( $arraycompany as $valuecompany ){
- print "arraycompany.push(\"$valuecompany\" );";
- }
- foreach( $arrayaddress as $valueaddress ){
- print "arrayaddress.push(\"$valueaddress\" );";
- }
- foreach( $arraycity as $valuecity ){
- print "arraycity.push(\"$valuecity\" );";
- }
- foreach( $arraytime as $valuetime ){
- print "arraytime.push(\"$valuetime\" );";
- }if ($result) {
- foreach( $arrayunit as $valueunit ){
- print "arrayunit.push(\"$valueunit\" );";
- }
- foreach( $arrayprice as $valueprice ){
- print "arrayprice.push(\"$valueprice\" );";
- } }
- ?>
- ;
- function createMarker(point, myIcon, arrayid, arraycompany, arrayaddress, arraycity, arraytime, arrayunit, arrayprice) { // function which create the marker
- var marker = new GMarker(point, {icon : myIcon});
- var html = ("Id: " ).bold() + arrayid[i+1] + ("<br>Company: " ).bold() + arraycompany[i+1] + ("<br>Address: " ).bold() + arrayaddress[i+1] + "<br>" + arraycity[i+1] + "<br><img src='./ressources/kronor.png' alt='kronor' title='kronor'> " + arrayprice[i+1] + " kr <br><img src='./ressources/clock.png' width='16px' height='16px' alt='last update' title='last update'> " + arraytime[i+1] + " " + arrayunit[i+1] ;
- GEvent.addListener(marker, 'click', function() {
-
- marker.openInfoWindowHtml(html);
- });
- return marker;
- }
-
- var myIcon = new GIcon(G_DEFAULT_ICON, "./ressources/marker.png" );
- myIcon.iconSize = new GSize(32,32);
- // Redimensionnement de l'icône (32*32)
- myIcon.shadow = '';
- // Ici, le marker n'aura pas d'ombre
- myIcon.iconAnchor = new GPoint(32,32);
- // Le point d'accroche de l'icône représentant le marker
- // sera décalé de 26px vers la gauche et de 1px vers le haut
- for (i=0; i<<?php echo $count; ?>; i++){ // for each entry of the database
-
- var point = new GLatLng(arrayLat[i] , arrayLon[i]); // create a point with database coordinates
- var marker = createMarker(point, myIcon, arrayid, arraycompany, arrayaddress, arraycity, arraytime, arrayunit, arrayprice); // call the function to create the marker
- // to place the marker
-
- /* Afficher le marqueur et l'info-bulle */
- map.addOverlay(marker);
- } // end of the loop FOR
- }; // end of if GBrowserIsCompatible
- } // end of function load
- -->
- //]]>
- </script>
|
auriez vous déjà rencontré ce problème ou une petite idée pour le problème?
merci! ---------------
Mon site : http://www.tucpakwafer.com
|