Skip to content

Instantly share code, notes, and snippets.

@hiro-matsuno
Last active August 29, 2015 14:04
Show Gist options
  • Save hiro-matsuno/027c6a74640c3ba20af8 to your computer and use it in GitHub Desktop.
Save hiro-matsuno/027c6a74640c3ba20af8 to your computer and use it in GitHub Desktop.
標準的なGoogleMaps操作
//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