2014-06-25 17 views
7

वापस नहीं लौटा रहा है मैंने 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 भविष्यवाणियों/सुझावों के साथ वापस लौटाया जा रहा है?

धन्यवाद

उत्तर

4

मुद्दा 6845 बग: Google मानचित्र JavaScript API - स्वत: पूर्ण प्रतिक्रिया शामिल नहीं place_id

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6845&q=place_id&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal

अद्यतन

यह समस्या यहां

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6845#makechanges

1

मैं जो देख रहा हूं उसकी पुष्टि कर सकता हूं। मुझे लगता है कि रोल रोल को पूरा करने के लिए हमें बस इंतजार करना होगा।

+0

यही बात तय किया गया है: कोई place_id ... – thepit23

+0

पुष्टि करने के लिए धन्यवाद। यह जानना अच्छा होगा कि क्या Google मानचित्र एपीआई पर स्वत: पूर्ण सेवा के बारे में भूल गए हैं या फिर भी वे सभी रिकॉर्ड्स पर place_id मानों को लागू करने की प्रक्रिया में हैं या नहीं। – user1116573

संबंधित मुद्दे