Die geodaten konnte ich erfolgreich mit
$previous = '';
($row = @mysql_fetch_assoc($result)){ ....
$current = $row['lat'];
if ($current == $previous) {
$row['lat'] += 0.005000;
}
$previous = $current;
ändern (sind ca. 400m Luftlinie)
in dem xml steht
<marker id="14333" studlist=" " name="Chunami from Bandit's World" address="44651 Herne" lat="51.508629" lng="7.149345" type="ja"/>
<marker id="14444" studlist=" " name="Delphi from Bandit's World" address="44651 Herne" lat="51.513629" lng="7.149345" type="ja"/>
es sind also verschiedene Daten da, aber angezeigt wird mir hier wieder nur Delphi aber an der ursprünglichen Adresse (die ich "eigentlich" versetzt habe)
das js, welches die map anzeigt:
//<=!=[=C=D=A=T=A=[
var customIcons = {
ja: {
icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png',
shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
},
nein: {
icon: 'http://labs.google.com/ridefinder/images/mm_20_orange.png',
shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
}
};
function load() {
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(51.162014, 10.450573),
zoom: 6,
mapTypeId: 'roadmap'
});
var infoWindow = new google.maps.InfoWindow;
// Change this depending on the name of your PHP file
downloadUrl('female_de_xml.php', function(data) {
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName('marker');
for (var i = 0; i < markers.length; i++) {
var id = markers[i].getAttribute("id");
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var studlist = markers[i].getAttribute("studlist");
var type = markers[i].getAttribute("type");
var point = new google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var html =
"<a href='/dog.php?id=" + id + "'>" + name + "</a>" +
"<br/><img src='/photo/" + id + "/" + id + ".jpg' height='70' width='' alt=''>" +
"<br />" +address +
"<br />" +studlist
;
var icon = customIcons[type] || {};
var marker = new google.maps.Marker({
map: map,
position: point,
icon: icon.icon,
shadow: icon.shadow
});
bindInfoWindow(marker, map, infoWindow, html);
}
});
}
function bindInfoWindow(marker, map, infoWindow, html) {
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(html);
infoWindow.open(map, marker);
});
}
function downloadUrl(url, callback) {
var request = window.ActiveXObject ?
new ActiveXObject('Microsoft.XMLHTTP') :
new XMLHttpRequest;
request.onreadystatechange = function() {
if (request.readyState == 4) {
request.onreadystatechange = doNothing;
callback(request, request.status);
}
};
request.open('GET', url, true);
request.send(null);
}
function doNothing() {}
//]=]=>
</script>
Alles anzeigen
EDIT:
Frau sollte die richtige Datei einbinden und dann sind da auch zwei Marker