Is it possible to reorder ionic list according to the click on a google maps marker?
是否可以根據谷歌地圖標記上的點擊重新排序離子列表?
I have a homepage that has a google map on top with a list under this map. I want the list to be reordered when a marker clicked. The item that is related with the marker click will come to the top of the list.
我有一個主頁,頂部有一個谷歌地圖,下面有一個列表。我希望在單擊標記時重新排序列表。與標記單擊相關的項目將顯示在列表的頂部。
Any idea how to do it or any examples that might help me? Is this feasible with ionic2 and google maps functionalities ?
知道如何做或任何可能對我有幫助的例子嗎?這對於ionic2和谷歌地圖的功能是否可行?
0
I solved this putting a function call that will sort the list, inside the marker listener. :D So your listener will look like this:
我解決了這個函數調用,它將在標記偵聽器內對列表進行排序。 :D所以你的聽眾會是這樣的:
google.maps.event.addListener(marker, 'click', () => {
this.map.setCenter(marker.getPosition());
this.infoWindow.open(this.map, marker);
this.sortWithMarkerClick(marker_key);
});
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2017/02/16/7201ca9eb6e6ddf8f06aeb8917c00a93.html。