वापस नहीं लौटा रहा है मैंने place_id
के पक्ष में Google को संदर्भित करने के बारे में संदेश देखा है और इसे लागू करने के लिए देख रहा था।Google स्थल एपीआई place_id
मैं AutocompleteService
उपयोग कर रहा हूँ लेकिन जब मैं इसे चलाने प्रतिक्रिया place_id
शामिल नहीं है, लेकिन reference
और id
शामिल है।
यहां एक त्वरित अनुकूलन मैं उदाहरण पेज के किया है (मैं jsfiddle पर डाल करने की कोशिश की, लेकिन इसे चलाने के लिए नहीं मिल सका):
<!DOCTYPE html>
<html>
<head>
<title>Retrieving Autocomplete Predictions</title>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
<script>
// This example retrieves autocomplete predictions programmatically
// from the autocomplete service, and displays them as an HTML list.
// The predictions will include a mix of places (as defined by the
// Google Places API) and suggested search terms.
function initialize() {
var service = new google.maps.places.AutocompleteService();
service.getQueryPredictions({ input: 'trafalgar square' }, callback);
}
function callback(predictions, status) {
if (status != google.maps.places.PlacesServiceStatus.OK) {
alert(status);
return;
}
var results = document.getElementById('results');
for (var i = 0, prediction; prediction = predictions[i]; i++) {
results.innerHTML += '<li>' + prediction.description + '</li>';
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<p>Query suggestions for 'trafalgar square':</p>
<ul id="results"></ul>
</body>
</html>
कोई व्याख्या कर सकते हैं कि मैं क्या याद कर रहा हूँ/गलत कर ?
क्या किसी को AutocompleteService
का उदाहरण मिला है place_id
भविष्यवाणियों/सुझावों के साथ वापस लौटाया जा रहा है?
धन्यवाद
यही बात तय किया गया है: कोई place_id ... – thepit23
पुष्टि करने के लिए धन्यवाद। यह जानना अच्छा होगा कि क्या Google मानचित्र एपीआई पर स्वत: पूर्ण सेवा के बारे में भूल गए हैं या फिर भी वे सभी रिकॉर्ड्स पर place_id मानों को लागू करने की प्रक्रिया में हैं या नहीं। – user1116573