获取多边形上的多边形对象单击角度2谷歌地图

时间:2017-03-06 09:14:31

标签: angular angular2-google-maps

我正在使用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>
    
&#13;
&#13;
&#13;

如何从点击

获取多边形对象

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

  }
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

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

(polyClick)=“click($ event)”变为(polyClick)=“click(polygon)”