Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

How to show one infowindow at time #1143

Closed
andreavigani opened this issue Feb 5, 2015 · 3 comments
Closed

How to show one infowindow at time #1143

andreavigani opened this issue Feb 5, 2015 · 3 comments

Comments

@andreavigani
Copy link

How can I show one infowindow at time automatically closing the previous opened infowindow?

This is my html code:

            <ui-gmap-markers models="markers" coords="'self'" click="'onClick'">
                <ui-gmap-windows show="show">
                    <div ng-non-bindable>{{title}}</div>
                </ui-gmap-windows>
            </ui-gmap-markers>

Are there some options to do that?
My markers are dinamically created by an http request:

$http.get('/api/aaa').success(function(data) {
                addMarker(data);
            })

$scope.markers = [];

var addMarker = function(items) {
            _.each(items, function(item) {
                var infobox = 'thecontent';

                $scope.markers.push({
                    id: item._id,
                    latitude:item.latitude,
                    longitude: item.longitude,
                    title: infobox
                });
            });
        };
@nmccready
Copy link
Contributor

I need to add this as an example or FAQ as it has been brought up frequently. Pleas search closed issues for "epiphany"

@nmccready
Copy link
Contributor

#83

@andreavigani
Copy link
Author

@nmccready I can't do it with ui-gmap. It doesn't show the infoWindow on click. How can I do that in my code?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants