markers ne s'affichent pas sour explorer 7 et 6
2 messages
• Page 1 sur 1
- serna
- Nouveau WRInaute

- Messages: 2
- Inscription: 8 Oct 2008
markers ne s'affichent pas sour explorer 7 et 6
Bonjour ,
j'utilise un script "Using PHP/MySQL with Google Maps" donné par google utilisant du php, xml
j'ai un problème sous explorer 7 ou 6 , les markers ne s'affiche pas alors qu'ils s'affichent sous firefox
http://www.memopage.com/voyages/google_carte/ville/rome_carte.html
à un moment ça a marché sous explorer mais j'ai du faire une fausse manip
merci de votre aide
voila le code sur la page qui affiche la carte
et ici le code du fichier qui gere le xml
j'utilise un script "Using PHP/MySQL with Google Maps" donné par google utilisant du php, xml
j'ai un problème sous explorer 7 ou 6 , les markers ne s'affiche pas alors qu'ils s'affichent sous firefox
http://www.memopage.com/voyages/google_carte/ville/rome_carte.html
à un moment ça a marché sous explorer mais j'ai du faire une fausse manip
merci de votre aide
voila le code sur la page qui affiche la carte
- Code: Tout sélectionner
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site Map</title> <script src="http://maps.google.com/maps?file=api&v=2&key=maclefs_WkobKsCPHGH6VMxSoCVXSfF8tSxwyT5d-82PtJNnJjA"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var iconBlue = new GIcon();
iconBlue.image = 'http://www.site/image/picto_carte_balade3.png';
iconBlue.iconSize = new GSize(30,32);
iconBlue.shadowSize = new GSize(22, 20);
iconBlue.iconAnchor = new GPoint(6, 20);
iconBlue.infoWindowAnchor = new GPoint(5, 1);
var iconRed = new GIcon();
iconRed.image = 'http://www.site/image/picto_carte_culture3.png';
iconRed.iconSize = new GSize(30,32);
iconRed.shadowSize = new GSize(22, 20);
iconRed.iconAnchor = new GPoint(6, 20);
iconRed.infoWindowAnchor = new GPoint(5, 1);
var iconYellow = new GIcon();
iconYellow.image = 'http://www.site/image/picto_carte_resto3.png';
iconYellow.iconSize = new GSize(30,32);
iconYellow.shadowSize = new GSize(25, 20);
iconYellow.iconAnchor = new GPoint(6, 20);
iconYellow.infoWindowAnchor = new GPoint(5, 1);
var iconGreen = new GIcon();
iconGreen.image = 'http://www.site/image/picto_carte_airport3.png';
iconGreen.iconSize = new GSize(30,32);
iconGreen.shadowSize = new GSize(25, 20);
iconGreen.iconAnchor = new GPoint(6, 20);
iconGreen.infoWindowAnchor = new GPoint(5, 1);
var customIcons = [];
customIcons["ballade"] = iconBlue;
customIcons["culture"] = iconRed;
customIcons["resto"] = iconYellow;
customIcons["aeroport"] = iconGreen;
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(41.894451, 12.478795), 10);
map.addControl(new GScaleControl());
GDownloadUrl("phpsqlajax_genxml2.php", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var id_pdf = markers[i].getAttribute("id_pdf");
var type = markers[i].getAttribute("type");
var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, name, address, type, id_pdf);
map.addOverlay(marker);
}
});
}
}
function createMarker(point, name, address, type, id_pdf) {
var marker = new GMarker(point, customIcons[type]);
var html = name + "<br/>" + "<a href=\"http://www.site/voyages/popme.php?pdf="+ id_pdf + "\" target=\"_blank\">" + address + "</a>" ;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html, {maxWidth:300, maxHeight:300,autoScroll:true});
});
return marker;
}
//]]>
</script>
</head>
<body onLoad="load()" onUnload="GUnload()">
<div id="map" style="width: 500px; height: 495px"></div>
</body>
et ici le code du fichier qui gere le xml
- Code: Tout sélectionner
<?php
require("config_base.php");
function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','<',$htmlStr);
$xmlStr=str_replace('>','>',$xmlStr);
$xmlStr=str_replace('"','"',$xmlStr);
$xmlStr=str_replace("'",''',$xmlStr);
$xmlStr=str_replace("&",'&',$xmlStr);
return $xmlStr;
}
////////////////////////////
/**
* Encodes an ISO-8859-1 mixed variable to UTF-8 (PHP 4, PHP 5 compat)
* @param mixed $input An array, associative or simple
* @param boolean $encode_keys optional
* @return mixed ( utf-8 encoded $input)
*/
function utf8_encode_mix($input, $encode_keys=false)
{
if(is_array($input))
{
$result = array();
foreach($input as $k => $v)
{
$key = ($encode_keys)? utf8_encode($k) : $k;
$result[$key] = utf8_encode_mix( $v, $encode_keys);
}
}
else
{
$result = utf8_encode($input);
}
return $result;
}
//////////////////////////////
// Opens a connection to a MySQL server
$connection=mysql_connect (ms1, $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Start XML file, echo parent node
echo '<markers>';
// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
echo '<marker ';
echo 'name="' . parseToXML($row['name']) . '" ';
echo 'address="' . parseToXML($row['address']) . '" ';
echo 'lat="' . $row['lat'] . '" ';
echo 'lng="' . $row['lng'] . '" ';
echo 'type="' . $row['type'] . '" ';
echo 'id_pdf="' . parseToXML($row['id_pdf']) . '" ';
echo '/>';
}
// End XML file
echo '</markers>';
?>
2 messages
• Page 1 sur 1
Lectures recommandées sur ce thème :
- Problème de rafraichissement en AJAX sour IE
- Problemes avec les é quant j'affiche le code sour
- Ce matin tous mes bl affichent pr 0
- markers Google Map sous IE
- Markers Google Map XML
- des humains affichent certaines premières pages Google ?
- les annonces adsense ne s affichent pas sur ma page index
- rechercher markers dans un fichier xml
- Différencier markers avec même latitude/longitude
- Liens markers Google Maps, javascript, référencement
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité
