久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

更新單項 GoolgeMap Cluster

Update single item GoolgeMap Cluster(更新單項 GoolgeMap Cluster)
本文介紹了更新單項 GoolgeMap Cluster的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 this libray 在 Android 中集群 GoogleMap.我的問題是如何更新我昨天通過谷歌瀏覽的單個項目,但沒有解釋更新單個項目的答案.我在我的項目中使用 websocket,所以我需要更新從 websocket 接收到的項目數據.下面看看我的實現.

I am using this libray to cluster GoogleMap in Android. My question is how can I update the single item I have gone through google from yesterday and no answers are there that explains updating single item. I am using websocket in my project so I need to update the data of item that were received from websocket. Look my implementation below.

我的概念是做mClusterManager.remove(項目)mClusterManager.add(item) + mClusterManager.cluster() 每當我從 websocket 接收數據.

My concept is doing mClusterManager.remove(item) mClusterManager.add(item) + mClusterManager.cluster() whenever I receive data from websocket.

和 hasmap 在添加到集群時識別循環中的對象,例如:hashmap.put(_id,mClusterItem[i]);

and hasmap to identify the object on loop while adding to cluseter like : hashmap.put(_id,mClusterItem[i]);

現在,每當收到 websocket 數據時,我都會這樣做,

Now, Whenever on websocket data is received I do,

    onDataReceive(String _id,String name, double latlng, ....){
    mClusterManager.remove(hashmap.get(_id));

   appClusterItem[0] = new AppClusterItem(.....);
    mClusterManager.add(appClusterItem[0])  // Here how can I add item 
    mClusterManager.cluster();
    }

但是,上面的代碼在收到第一個數據時首先工作,然后從第二次開始,它將繼續添加標記并且無法刪除,這意味著找不到 mClusterManager.remove(hasmap.get(_id)).而 appClusterItem[0] 是因為我不能使用 hashmap.get(_id);在上述情況下,因為它給出了預期的錯誤變量.無論如何要刪除相同的對象并在該位置添加對象??

However the above code works first when first data receives, then from second time it will just keep adding the marker and fails to remove that means mClusterManager.remove(hasmap.get(_id)) is not found. And appClusterItem[0] is because I cannot use hashmap.get(_id); on above case bacause it give error variable expected. Anyway to remove the same object and add object on that place??

推薦答案

我也嘗試通過 mClusterManager.remove 從集群中刪除標記,但遇到了一些問題.因此,就我而言,當我收到數據更改時,我會這樣做:我刪除了需要從列表中刪除的項目,使用 mClusterManager.clearItems(); 清除集群上的所有標記并將新數據放入集群.

I also tried to remove marker from cluster via mClusterManager.remove and have some problem with it. So in my case, when I received data changes I make this: I remove item that i need to remove from my list, clear all markers on cluster with mClusterManager.clearItems(); and put fresh data to cluster.

這篇關于更新單項 GoolgeMap Cluster的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why would you choose Android API over Google APIs in the SDK on Eclipse?(為什么在 Eclipse 的 SDK 中選擇 Android API 而不是 Google API?)
Couchbase Bucket authentication error(Couchbase 存儲桶身份驗證錯誤)
admob 6.2.1 nullpointer exception(admob 6.2.1 空指針異常)
How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中設置 SDK?)
My phone cannot be detected in eclipse to test run(eclipse 無法檢測到我的手機進行試運行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 在线一区观看 | 欧美日本一区 | 国内毛片毛片毛片毛片 | 91精品久久久久久久久中文字幕 | 欧美久久不卡 | 一级毛片视频在线观看 | 中文字幕 在线观看 | 91精品国产91久久久久久 | 在线视频91| 欧美精品中文字幕久久二区 | 欧美另类日韩 | 欧美成人aaa级毛片在线视频 | 久草视频观看 | 91成人在线| 黄色网络在线观看 | av电影一区| 久久国产精品久久久久久久久久 | av先锋资源 | 午夜小视频在线播放 | 亚洲人精品 | 91久久夜色精品国产网站 | 中文字幕不卡在线观看 | 午夜一级做a爰片久久毛片 精品综合 | 日韩三级一区 | 欧美日韩中| 中文视频在线 | 久久久国产一区 | 免费成人在线网站 | 欧美高清免费 | 日本人做爰大片免费观看一老师 | 国产资源在线播放 | 日韩视频三区 | 精品免费国产一区二区三区 | 欧美性一区二区三区 | 国产在线高清 | 精品久 | 色播久久久 | 亚洲精品一区国语对白 | 成人亚洲在线 | 99精品国产一区二区青青牛奶 | 国产精品福利在线 |