satya chowdary satya chowdary - 11 days ago 9
AngularJS Question

how to close map marker info window on external click

i am showing a map data using ui-gmap-google-map like below

<ui-gmap-google-map center='map.center' zoom='map.zoom'>
<ui-gmap-window show="map.window.show" coords="map.window.model" options="map.window.options" closeClick="map.window.closeClick()">
<div style="color: black">
{{map.window.title}}
</div>
</ui-gmap-window>
<ui-gmap-markers dorebuildall="true" idkey="marker.id" models="map.markers" coords="'self'" doCluster="false" fit="'true'" icon="'icon'" events="map.markersEvents " options="'options'"></ui-gmap-markers>
</ui-gmap-google-map>


from this i can see the markers on map and when i click on a marker i am getting an info window as well i am showing marker data out side of map in a separate div.now my question is how can i close this marker info window when i close the information div.

i can provide my js if you need.

Answer

seems you are accessing your marker from scope.map.....so u can simply use the below code in your

$scope.map.window.show=false;
Comments