当谷歌地图标记点击时,离子重新排序

[英]Ionic Reorder when a google maps marker click


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和谷歌地图的功能是否可行?

1 个解决方案

#1


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);
});
智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2017/02/16/7201ca9eb6e6ddf8f06aeb8917c00a93.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告