Google Maps Imageに表示されている場合、ラベルテキストは英語とその他の言語(テルグ語)で表示されます。ラベルテキストを英語で表示し、他の言語ラベルテキストを非表示にする方法はありますか?Googleマップからローカル言語ラベルを削除
ありがとうございました
Google Maps Imageに表示されている場合、ラベルテキストは英語とその他の言語(テルグ語)で表示されます。ラベルテキストを英語で表示し、他の言語ラベルテキストを非表示にする方法はありますか?Googleマップからローカル言語ラベルを削除
ありがとうございました
はい、もちろんです!
ラベルの言語を設定するのは非常に簡単です。 google maps apiをダウンロードするときには、パラメータ言語を追加する必要があります。ここでは英語での要求の例である:
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&language=en®ion=EG&callback=initMap"></script>
そして、これは英語のラベルを持つエジプトの完全なコードです:
// This example displays a map with the language set to Arabic and the
// regions set to Egypt. These settings are specified in the HTML script
// element when loading the Google Maps JavaScript API.
// Setting the language shows the map in the language of your choice.
// Setting the region biases the geocoding results to that region.
// In addition, the page's html element sets the text direction to
// right-to-left.
function initMap() {
var cairo = {lat: 30.064742, lng: 31.249509};
var map = new google.maps.Map(document.getElementById('map'), {
scaleControl: true,
center: cairo,
zoom: 10
});
var infowindow = new google.maps.InfoWindow;
infowindow.setContent('<b>القاهرة</b>');
var marker = new google.maps.Marker({map: map, position: cairo});
marker.addListener('click', function() {
infowindow.open(map, marker);
});
}
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script async defer
src="https://maps.googleapis.com/maps/api/js?&language=en®ion=EG&callback=initMap"></script>
あなたには、いくつかの質問がある場合を教えてください、
スフィンクス
あなたは、それは英語のみが表示されますローカル言語に
language=uk
https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&language=uk®ion=EG&callback=initMap
を削除するには、これを設定することができます。
スクリプトをこのmaps.googleapis.com/maps/api/js?&language=en®ion=IN&callback=initMapに変更しましたが、英語とテルグ語(時にはヒンディー語)が表示されます。問題はヒンディー語またはテルグ語のみを表示せず、英語のみを表示することです。 – nopapa
完全なコード(またはマップを初期化する部分だけでなく、スクリプトがマップ上の大きな変更を...)を私に与えると、より効率的になります。私はすでにあなたにもっとお手伝いすることはできません。あなたは私の実行スニペットと同じ結果を持っていますか?スニペットを実行すると同じ結果になります。次のドキュメントを参照してください。https://google-developers.appspot.com/maps/documentation/javascript/examples/map-rtl –
そして、私のコードは、あなたが言語と地域の属性の違いでスニペットに書いたものと同じです。私は何も見つけられなかったドキュメントを調べました。 英語のラベルのみを表示することができますか? – nopapa