angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

When clicking on marker to show window, show window called twice

Open molekilla opened this issue 8 years ago • 1 comments

Hi

<ui-gmap-google-map center='map.center' zoom='map.zoom' events='map.events' control="map.control" refresh="map.refresh" options="map.options" styles="map.styles">
    <ui-gmap-window coords="infowindow.coords" options="infowindow.options" closeClick="infowindow.close" templateUrl="infowindow.templateUrl" templateParameter="infowindow.templateParameter" show="infowindow.show" ng-cloak>
    </ui-gmap-window>
    <ui-gmap-markers models="markers" options="'options'" coords="'coords'" icon="'icon'" control="control">
    </ui-gmap-markers>        
</ui-gmap-google-map>

For the following code, if window show=false, the ui-gmap-window directive link function gets called twice, thus when an user clicks the first time it occurs twice. Closing and opening again fixes it.

if show=true, closing and opening works too. My question is: Do I need to have an opened window when the app boots/starts? Seems to me it shouldn't hit twice the directive's link.

Thanks

molekilla avatar May 12 '16 19:05 molekilla

Im having theexact same behavior, here is my code

<ui-gmap-google-map id="business-map" center='map.center' zoom='map.zoom' pan='map.pan' data-events="map.markersEvents">
        <ui-gmap-markers models="businessMarkers" coords="'self'" doCluster="true" icon="'icon'" click="onClickMarker">
        </ui-gmap-markers>
        <ui-gmap-window coords='markerCenter' show='visible' isIconVisibleOnClick='true' closeClick='true' options='window.options'>
          <div id="info-window-node">
            <h4><i class="fa fa-shopping-basket"></i>&nbsp;&nbsp;{{biz.name}}</h4>
            <div class="map-window-image-container">
              <img ng-click="$root.loadBusinessView(biz.bid, false)" ng-src="{{biz.logo}}">
            </div>
            <h5>{{biz.address1}}</h5>
            <p>{{biz.phone}}</p>
          </div>
        </ui-gmap-window>
      </ui-gmap-google-map>

camicase82 avatar Dec 08 '16 19:12 camicase82