map icon indicating copy to clipboard operation
map copied to clipboard

Is there a way to trigger click on marker programmatically, to open info window?

Open VlnRbn opened this issue 8 years ago • 0 comments

Thanks for ngui-map, Currently using it in a project, The client want the info-window open on click of some button in the DOM. Tried using the following to get reference of markers (used ngFor) @ViewChildren ('marker') markerRef : QueryList<google.maps.Marker>;

onClickShowInfo(){
        this.markerRef.changes.subscribe(() => {
            console.log("divs- info-window", this.markerRef.toArray() )
            if(this.markerRef.toArray().length > 0){
                let mkr = this.markerRef.toArray()['0']
                console.log("marker",mkr)
                google.maps.event.trigger( mkr , 'click');
            }
        });
}

The event obtained when actually clicking on marker, and triggering the above are different to run this.nguiMapComponent.openInfoWindow('marker_pws', marker);

/** Edit **/ want to implement something like this http://jsfiddle.net/fJ4jG/9/

Any help will be appreciated, Thanks,

VlnRbn avatar Apr 13 '18 07:04 VlnRbn