有了placeId,我需要获取地方详细信息。我可以使用以下代码执行此操作:
var service = new google.maps.places.PlacesService(document.createElement("div"));
service.getDetails({
placeId: locationReference
}, parseLocationDetailResponse.bind(null, function(addressObject) {
deferred.resolve(addressObject);
}));
如何手动指定地点详细信息对象的语言?
答案 0 :(得分:1)
Google地图提供您需要的list种语言。在脚本&language=(type of language)
scr
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&language=ja"></script>
<div id="map-canvas"></div>