-1
次のkmlファイルはGoogle Earthでレンダリングされています。しかし、Googleの地図で同じことをしようとすると、何も表示されません。これには何が考えられますか?このタイプのファイルはGoogleマップに表示されませんか?KmlファイルはGoogle Earthに表示されますが、Google Mapsには表示されません
ありがとうございます。
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Data from a local source.</name>
<Region>
<Lod><minLodPixels>2</minLodPixels></Lod>
<LatLonAltBox>
<west>75.2971420288086</west>
<east>154.70285034179688</east>
<south>-11.705361366271973</south>
<north>30.36050796508789</north>
</LatLonAltBox>
</Region>
<GroundOverlay>
<drawOrder>1</drawOrder>
<Icon>
<href>http://www.rimes.int/files/image.png</href>
</Icon>
<LatLonBox>
<west>75.2971420288086</west>
<east>154.70285034179688</east>
<south>-11.705361366271973</south>
<north>30.36050796508789</north>
</LatLonBox>
</GroundOverlay>
</Document>
</kml>
私が使用しているコードは次のとおりです。
<div id="map"></div>
<script type="text/javascript">
function initMap() {
var map = new google.maps.Map(
document.getElementById('map'),
{
zoom: 2,
center: {lat: 7.794106, lng: 80.677808}
});
var ctaLayer = new google.maps.KmlLayer({
url: 'http://www.rimes.int/files/erddap_kml.kml',
//url: 'http://www.rimes.int/files/new-new-2.kml',
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=MY_API_KEY_HERE&callback=initMap">
</script>
このコードは、上述したファイルとは異なる別のKMLファイル(コメント「URL」)のために働いている。代わりのイメージオーバーレイを使用して、それが座標に基づいてスタイルを満たすオーバーレイ。
どうすれば間違っている可能性がありますか?ありがとうございました。
ではサポートされていませんか? – geocodezip
Google Maps JavaScript APIを使用して表示しています (https://developers.google.com/maps/documentation/javascript/tutorials/kml)タグを持つ他のkmlファイルを使用している場合は、その表示になります。しかし、私が投稿したもの(を使用)は表示されていません。 –
Sujal
投稿されたファイルは[Google Maps Javascript API v3 for me](http://www.geocodezip.com/v3_GoogleEx_layer-kml_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/kml/SO_20160718)で動作します.kml)。あなたの問題を示す[最小、完全、テスト済みおよび読みやすい例](http://stackoverflow.com/help/mcve)を提供してください。 – geocodezip