0

自从https://github.com/SebastianM/angular-google-maps/的 AGM v3.0.0-beta 的到来(一个流行的 repo)我很困惑如何使用添加图例或 MapControl(最好是图例)这个库。

到目前为止,我已尝试“扩展” 的基类,AgmMapControl但我不知道如何设置 HTML 或如何通过 Angular 使用它。

这是我的地图:

<agm-map *ngIf="activitiesMapData.length > 0"
             [mapTypeId]="user && user.settings ? user.settings.mapSettings.mapType : 'roadmap'"
             (mapTypeIdChange)="changeMapType($event)"
             [gestureHandling]="'cooperative'"
             [scrollwheel]="null"
             [tilt]="45"
             [controlSize]="32"
             [disableDefaultUI]="true"
             [styles]="getStyles(theme)">

我想获得有关如何使用 AGM 创建简单的基于 HTML/基于 Angular 的图例并添加到我的地图的帮助。

就像这里建议的那样:

https://developers.google.com/maps/documentation/javascript/adding-a-legend

4

0 回答 0