iT邦幫忙

0

ngx-openlayers如何取得點擊的經緯度

目前使用angular的套件ngx-openlayers實作地圖,

import { MapComponent } from 'ngx-openlayers';
this.mapComponent.onClick.subscribe((event) => {
      console.log(event);
    });

這樣可以取得每次點擊到的地圖資訊,
問題是這些資訊中沒有經緯度,
查資料後知道jquery版的openlayers是用getLonLatFromViewPortPx將座標轉換成經緯度,
但是ngx-openlayers似乎沒有這個功能啊...
其他部份都運作良好,
實在不想為了這個功能整個地圖打掉換用jquery版...
還請各位解惑,感謝。

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
WilliamHuang
iT邦研究生 1 級 ‧ 2018-03-30 18:10:59
【**此則訊息已被站方移除**】

尚未有邦友回答

立即登入回答