34. geolocationとは
◇ Google Mapを表⽰示
headタグ内に以下を追加
スクリプト内に以下のロジックを追加
<script src="http://maps.googleapis.com/maps/api/js?
sensor=false"></script>
// 地図を表⽰示
map = new google.maps.Map(
document.getElementById(”id名"),{
zoom : 15,
center : new google.maps.LatLng(0,0),
mapTypeId : google.maps.MapTypeId.ROADMAP
}
);
// マーカーを表⽰示
marker = new google.maps.Marker({
position: new google.maps.LatLng(0,0),
map: map
});
35. geolocationとは
◇ Google Mapを表⽰示
headタグ内に以下を追加
スクリプト内に以下のロジックを追加
<script src="http://maps.googleapis.com/maps/api/js?
sensor=false"></script>
// 地図を表⽰示
map = new google.maps.Map(
document.getElementById(”id名"),{
zoom : 15,
center : new google.maps.LatLng(0,0),
mapTypeId : google.maps.MapTypeId.ROADMAP
}
);
// マーカーを表⽰示
marker = new google.maps.Marker({
position: new google.maps.LatLng(0,0),
map: map
});
36. geolocationとは
◇ Google Mapを表⽰示
マップとマーカーを特定の場所に更更新する場合
function setMarker(lat, lon){
var pos = new google.maps.LatLng(lat, lon);
map.setCenter(pos);
marker.setPosition(pos);
}