Nabend!
Ich brauche mal einen Tip oder Hilfe :-)
Ich habe auf folgender Site (http://www.sebastian-harder.de/?q=node/10) folgendes script gefunden (http://sebastian-harder.de/gps/geo.html)
Code:
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
$(function() {
if (navigator.geolocation) {
navigator.geolocation.watchPosition(positionSuccess, positionError, { enableHighAccuracy:true, maximumAge:600000, timeout:0 });
} else {
positionError(-1);
}
});
function positionError(err) {
var msg;
switch(err.code) {
case err.UNKNOWN_ERROR:
msg = "Unable to find your location";
break;
case err.PERMISSION_DENINED:
msg = "Permission denied in finding your location";
break;
case err.POSITION_UNAVAILABLE:
msg = "Your location is currently unknown";
break;
case err.BREAK:
msg = "Attempt to find location took too long";
break;
default:
msg = "Location detection not supported in browser";
}
$('#error').text(msg);
}
function positionSuccess(position) {
// Centre the map on the new location
var coords = position.coords || position.coordinate || position;
var longitude = coords.longitude;
var latitude = coords.latitude;
$('#longitude').text(longitude);
$('#latitude').text(latitude);
}
</script>
Das ist auch alles ganz toll, nur möchte ich gerne mit den Daten weiterarbeiten. Wie übergene ich "longitude" und "latitide" an PHP zb. $yourLng $ yourLat
Kann mir jemand sagen wie das geht?
Beste Dank und Grüße,
derDenis