1

I'm using ng-map and typescript. This is my template :

<map on-tilesloaded="showInfoWindow('myInfoWindow')" center="{{model.adresseLatitude}}, {{model.adresseLongitude}}" zoom="15" style="height: 425px">
    <marker id="gmapMarker" on-click="showInfoWindow('myInfoWindow')" position="{{model.adresseLatitude}}, {{model.adresseLongitude}}">
        <info-window id="myInfoWindow">
            <div ng-non-bindable="">
                {{model.adresse}}
            </div>
        </info-window>
    </marker>
</map>

When the map is loaded the infoWindow is shown on the top left of the map but it works fine when the marker is clicked.

I would like that the infowindow open at the right place (on the marker) when the map is displayed.

simon
  • 1,180
  • 3
  • 12
  • 33
Pak
  • 2,639
  • 2
  • 21
  • 27

1 Answers1

2

Instead of on-tilesloaded="showInfoWindow('myInfoWindow')" in map directive you can use visible-on-marker="markerID" in <info-window> tag. i.e: <info-window id="myInfoWindow" visible-on-marker="markerID">

like:

<map center="{{model.adresseLatitude}}, {{model.adresseLongitude}}" zoom="15" style="height: 425px">
    <marker id="gmapMarker" on-click="showInfoWindow('myInfoWindow')" position="{{model.adresseLatitude}}, {{model.adresseLongitude}}">
        <info-window id="myInfoWindow" visible-on-marker="gmapMarker">
            <div ng-non-bindable="">
                {{model.adresse}}
            </div>
        </info-window>
    </marker>
</map>
Shaishab Roy
  • 16,335
  • 7
  • 50
  • 68