Ich habe einige Tests gemacht mit google.loader.ClientLocation aus:Ist google.loader.clientlocation unterstützt noch
Aber ich null für den Test:
if (google.loader.ClientLocation)
Dies ist das Verhalten, wenn Google keine Informationen für IP findet.
Ich suchte StackOverflow und es gibt eine Menge Fragen, aber keine guten Antworten.
suchte ich im Netz und sah diese zwei Verbindungen:
- https://groups.google.com/forum/?fromgroups=#!topic/google-ajax-search-api/8q_oG-Y9fp8
- http://code.google.com/p/google-ajax-apis/issues/detail?id=586
- https://groups.google.com/forum/?fromgroups=#!topic/google-ajax-search-api/rzoIh4RrtOQ
was zu sagen scheinen sollte der Navigator HTML geo Standort verwendet werden.
Google API-Dokumentation erwähnt es nicht mehr.
Ich möchte eine Bestätigung, ob Google google.loader.clientlocation noch funktioniert oder nicht?
Mein Code ist folgende:
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
</head>
<body>
<script type="text/javascript">
function geoTest() {
if (google.loader.ClientLocation) {
var latitude = google.loader.ClientLocation.latitude;
var longitude = google.loader.ClientLocation.longitude;
var city = google.loader.ClientLocation.address.city;
var country = google.loader.ClientLocation.address.country;
var country_code = google.loader.ClientLocation.address.country_code;
var region = google.loader.ClientLocation.address.region;
var text = 'Your Location<br /><br />Latitude: ' + latitude + '<br />Longitude: ' + longitude + '<br />City: ' + city + '<br />Country: ' + country + '<br />Country Code: ' + country_code + '<br />Region: ' + region;
} else {
var text = 'Google was not able to detect your location';
}
document.write(text);
}
geoTest();
</script>
</body>
</html>
es noch funktioniert, aber nicht zuverlässig –
Vielen Dank für Antwort, haben Sie einige Links haben, der das sagt. Von dem zweiten Link, den ich in Frage stelle, scheint es sogar Google zu sagen, etwas anderes zu benutzen. –
Ich habe keinen Link, aber ich weiß es, denn gestern gibt es ein Ergebnis für mich (nicht gut, 300km von meiner Position entfernt). Es gibt möglicherweise keine aktive Unterstützung, aber sie ist immer noch vorhanden (sonst würde ich gestern kein Ergebnis erhalten und 'google.loader.ClientLocation' wäre 'undefiniert', wenn kein Ergebnis verfügbar ist, aber 'null'). Ich habe keine offizielle Ankündigung gesehen, dass es nicht mehr unterstützt wird, ein Kommentar in einer Newsgroup ist keine offizielle Aussage. –