代码之家  ›  专栏  ›  技术社区  ›  Nancy

agm信息窗口-如何将位置更改为右侧

  •  2
  • Nancy  · 技术社区  · 8 年前

    我用谷歌地图和角度来显示地图,标记和信息窗口。信息窗口始终位于顶部。如何将其位置改为右侧?

    <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
      <agm-marker *ngFor="let m of mapArrayList; let i = index" (markerClick)="clickedMarker(infowindow)" [latitude]="m.geometry.location.lat"
        [longitude]="m.geometry.location.lng">
        <agm-info-window #infowindow>
    <div>{{name}}</div>
      </agm-info-window>
    
    2 回复  |  直到 7 年前
        1
  •  0
  •   Exterminator    8 年前

    你可以查看这个链接,它描述了如何改变信息栏的位置 Components AgmSnazzyInfoWindow

    把这个位置传给 [placement] 喜欢 top, bottom, right, left

        2
  •  0
  •   johey    7 年前

    很抱歉这么晚才回复。。。我没有任何使用角度谷歌地图的经验,但看起来你可以通过插件调整窗口的外观和行为 时髦的信息窗口 . https://github.com/atmist/snazzy-info-window

    参见 安置 信息窗口的属性(上/下/左/右): https://github.com/atmist/snazzy-info-window#placement

    为了将时髦与角度谷歌地图结合使用: https://angular-maps.com/guides/snazzy-info-window/custom-info-windows-with-snazzy-info-window/

    祝你好运

    推荐文章