2017-04-19 62 views
0

我想建立一個角2應用程序,我想檢索地址和我的谷歌地圖上點擊的地方的所有信息。檢索信息點擊谷歌地圖角2

這裏是我的代碼:

<sebm-google-map (mapClick)="getPosition($event)" [latitude]="lat" [longitude]="lng" [zoom]="zoom" [backgroundColor]="backgroundColor" style="margin-bottom:900px"> 
    <sebm-google-map-marker *ngFor=" let post of posts" [latitude]="post.lapti" [longitude]="post.longi" ></sebm-google-map-marker> 
</sebm-google-map> 

任何解決方案?

回答

0

試試這個,你可以使用它在

<sebm-google-map [latitude]="lat" [longitude]="lng" [zoom]="zoom" class="content-map"> 
    <sebm-google-map-marker [latitude]="lat" [longitude]="lng" [markerDraggable]="true" (dragEnd)="getCordinates($event)"> 
    </sebm-google-map-marker> 
</sebm-google-map> 

對於點擊使用:

<sebm-google-map [latitude]="lat" [longitude]="lng" [zoom]="zoom" class="content-map"> 
    <sebm-google-map-marker [latitude]="lat" [longitude]="lng" (markerClick)="getCordinates($event)"> 
    </sebm-google-map-marker> 
</sebm-google-map> 

(markerClick)="getCordinates($event)"sebm-google-map-marker

+0

是可以分開檢索其他信息緯度和經度? –

+0

你可以通過console.log $ event來檢查params,@LaamiriOussema –