Google Map 挿入
//----------------------------------------------------
// Google Map カスタマイズ
//----------------------------------------------------
google.maps.event.addDomListener(window, 'load', function() {
var latlng = new google.maps.LatLng(34.683745,135.179998); //座標を入力
var myOptions = {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false,
mapTypeControl: false,
scaleControl: false,
zoomControl: true,
};
var map = new google.maps.Map(document.getElementById('map-canvas'), myOptions);
var markerOptions = {
position: latlng,
map: map,
title: 'hogehoge' //タイトル
};
var marker = new google.maps.Marker(markerOptions);
/* スタイル付き地図 */
var styleOptions = [{
/* 市区名 */
featureType: 'administrative.locality',
elementType: 'labels',
stylers: [{ visibility: 'on' }, { lightness: '20' }]
}, {
/* 風景(ベージュ) */
featureType: 'landscape',
elementType: 'geometry',
stylers: [{ hue: '#ff0000' }, { lightness: '39' }]
},{
/* 公園 */
featureType: 'poi.park',
elementType: 'geometry',
stylers: [{ visibility: 'simplified' }, { hue: '#40AE4B' }, { lightness: '35' }, { saturation: '40' }]
}, {
/* すべての道路 */
featureType: 'road',
elementType: 'geometry',
stylers: [{ visibility: 'simplified' }, { hue: '#F9D004' }, { lightness: '100' }, { saturation: '80' }]
}, {
/* 高速道路 */
featureType: 'road.highway',
elementType: 'geometry',
stylers: [{ lightness: '-30' }]
}, {
/* 駅(イエロー) */
featureType: 'transit.station',
elementType: 'geometry.fill',
stylers: [{ visibility: 'on' }, { color: '#F9D004' }]
}, {
/* 線路(グリーン) */
featureType: 'transit.line',
elementType: 'geometry',
stylers: [{ visibility: 'on' }, { color: '#40AE4B' }]
},{
/* 駅名(グレー) */
featureType: 'transit.station.rail',
elementType: 'labels.text.fill',
stylers: [{ visibility: 'on' }, { color: '#333333' },]
}, {
/* 水域(ブルー) */
featureType: 'water',
elementType: 'geometry',
stylers: [{ visibility: 'on' }, { hue: '#43A8CA' }, { saturation: '20' }, { lightness: '10' }]
}];
});
<!--headに挿入-->
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!--マップ埋め込み-->
<div id="map-canvas"></div>