angularjs - Google maps event for marker addition -
hi using angulargm library https://github.com/dylanfprice/angular-gm project. provides directives google maps , markers . there no support markerclusterer in library. therefore need map , marker instances in code add support . map instance available through service markers not .the library provides wrapper google map events , passes marker instances callbacks. need know if there event triggered when marker added google maps.
<script> var map; function initialize() { var mapoptions = { zoom: 10, center: new google.maps.latlng((some latitude), (some longitude)) }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var marker = new google.maps.marker({ map: map, position: map.getcenter() }); var infowindow = new google.maps.infowindow(); infowindow.setcontent('<div id="infowindow"><b>info text</b> <br /> more info text</div>'); infowindow.open(map, marker); google.maps.event.addlistener(marker, 'click', function () { infowindow.open(map, marker); }); } google.maps.event.adddomlistener(window, 'load', initialize); </script>
Comments
Post a Comment