Last active
August 29, 2015 14:04
-
-
Save hiro-matsuno/027c6a74640c3ba20af8 to your computer and use it in GitHub Desktop.
標準的なGoogleMaps操作
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//GoogleMapsの座標設定 | |
var initPos = new google.maps.LatLng(34.73027800000027,136.5085889999976); | |
//GoogleMapsの表示設定 | |
var myOptions = { | |
noClear : true, | |
center : initPos, | |
zoom : 17, | |
mapTypeId : google.maps.MapTypeId.ROADMAP | |
}; | |
//map_canvasへの書き込み | |
var map_canvas = new google.maps.Map(document.getElementById("map_canvas"), myOptions); | |
//KMLファイルの読み込み | |
var kmlUrl = "KMLファイル名"; | |
//KMLレイヤの設定 | |
var kmlLayer = new google.maps.KmlLayer(kmlUrl, {preserveViewport:true}); | |
//KMLレイヤのmap_canvasへの追加 | |
kmlLayer.setMap(map_canvas); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment