google map - add marker

<script type="text/javascript"> var map; function initMap() { map = new google.maps.Map(document.getElementById('map'), { center: {lat: 33.3, lng: 43.5}, zoom: 6 }); // add marker var image = 'icon/5.png'; var marker = new google.maps.Marker({ position: {lat: 33.3, lng: 43.5}, map: map, icon: image, title:'1', }); // add marker var image = 'icon/4.png'; var marker = new google.maps.Marker({ position: {lat: 35.3, lng: 43.5}, map: map, icon: image, title:'2', }); // add marker var image = 'icon/3.png'; var marker = new google.maps.Marker({ position: {lat: 32.3, lng: 44.5}, map: map, icon: image, title:'3', }); // add marker var image = 'icon/2.png'; var marker = new google.maps.Marker({ position: {lat: 34.3, lng: 42.5}, map: map, icon: image, title:'4', }); } </script>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.