google map v3で複数マーカー
こんな感じになりました。
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng( center_lat, center_lon); var myOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var data = new Array(); data.push({position: new google.maps.LatLng( lat1, lon1 ), content: 'a', icon: 'icon_url.png'}); data.push({position: new google.maps.LatLng( lat2, lon2 ), content: 'b', icon: 'icon_url.png'}); data.push({position: new google.maps.LatLng( lat3, lon3 ), content: 'c', icon: 'icon_url.png'}); data.push({position: new google.maps.LatLng( lat4, lon4 ), content: 'd', icon: 'icon_url.png'}); for(i=0;i<data.length;i++){ var marker = new google.maps.Marker({ position: data[i].position, title: data[i].content, icon: data[i].icon }); marker.setMap( map ); } } </script>