0

我正在使用https://angular-maps.com/docs/api/latest/ts/core/index/SebmGoogleMapPolygon-directive.html,用于谷歌地图,

  
      
       <sebm-map-polygon *ngFor="let polygon of polygonPathDatas" 
        [paths]="polygon.path"
        [clickable] = "true"
        strokeColor ="#00000"
        [strokeWeight]=".6"      
        [editable]="false"
        [draggable]="false" 
        (polyClick)="click($event)" 
        (polyDblClick)="delete($event)">
      </sebm-map-polygon>
    

如何从单击中获取多边形对象

  click($event: any) {
    console.log(event);

  }

4

1 回答 1

0

在事件处理程序中传递数组的实例。

(polyClick)="click($event)" 变为 (polyClick)="click(polygon)"

于 2017-03-08T05:08:45.010 回答