Gmap Javascript API v3 でレンダリングされた Google マップにハイブリッド、サテライト、テレイン、物理ビュー モードを追加するにはどうすればよいですか?
私のコードは次のようになります:
var myLatlng = new google.maps.LatLng(47.283902, 11.526825);
var mapOptions = {
zoom: 14,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControlOptions: {
mapTypes: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.TERRAIN]
}
};
directionsService = new google.maps.DirectionsService();
directionsDisplay = new google.maps.DirectionsRenderer();
map = new google.maps.Map(document.getElementById("gmap"), mapOptions);
directionsDisplay.setMap(map);
しかし、これはうまくいかないようです!