how to open infowindows of google maps from a button?

1

.HTML file where an ng-repeat of the markers stored in an array is executed on an ionic-radio

       <div class="lista">
            <ion-scroll class="listContainer">
                <ion-list class="listoo">
                    <!--lista de los marcadores y evento click al seleccionar un marcador -->
                    <ion-radio ng-repeat="lugares in array_marcadores" ng-click="setMarcadores(lugares.posLat,lugares.posLng)"><div id="tree">{{lugares.nombre}}</div></ion-radio>
                </ion-list>
            </ion-scroll>
        </div>

Controller that receives the parameters from the selected button.

     $scope.setMarcadores = function (posLat, posLng) {
        var posicion = new google.maps.LatLng(posLat, posLng);
        map.panTo(posicion);
        };
    };

Array where the bookmarks are contained, the name field is going to be the content of the infowindow

    $scope.array_marcadores = [
        {
            "id": "545433",
            "nombre": "GP1",
            "posLat": "10.150185152432623",
            "posLng": "-68.51857423782349"
        }, {
            "id": "545543",
            "nombre": "GP2",
            "posLat": "10.149667666876198",
            "posLng": "-68.5180538892746"
        }, {

I want an infowindow to be executed according to the marker that was selected with its respective description

    
asked by German Steven Vera Amaya 05.04.2017 в 21:11
source

0 answers