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

更新單項 GoolgeMap Cluster

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

問題描述

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

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 接收數(shù)據(jù).

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

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

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

現(xiàn)在,每當收到 websocket 數(shù)據(jù)時,我都會這樣做,

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();
    }

但是,上面的代碼在收到第一個數(shù)據(jù)時首先工作,然后從第二次開始,它將繼續(xù)添加標記并且無法刪除,這意味著找不到 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 從集群中刪除標記,但遇到了一些問題.因此,就我而言,當我收到數(shù)據(jù)更改時,我會這樣做:我刪除了需要從列表中刪除的項目,使用 mClusterManager.clearItems(); 清除集群上的所有標記并將新數(shù)據(jù)放入集群.

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模板網(wǎng)!

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

相關文檔推薦

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精品中文字幕一区二区三区 | 91av视频在线观看 | 亚洲欧美激情视频 | 国产情侣在线看 | 亚洲成人免费电影 | 91精品国产综合久久精品 | 伊人一区 | 日韩一二区在线 | 99pao成人国产永久免费视频 | 精品一区精品二区 | 国产成人网 | 国产精品久久久 | 亚洲精久久久 | 欧美老妇交乱视频 | 日韩精品中文字幕一区二区三区 | xnxx 日本免费 | 91综合网 | 久久精品色欧美aⅴ一区二区 | 国产综合久久 | 精品久久久久久亚洲综合网 | 成人在线小视频 | 国产精品毛片无码 | 麻豆国产一区二区三区四区 | 午夜小视频在线观看 | 天天射网站| 日韩在线视频免费观看 | 国产真实精品久久二三区 | 国产乱码精品一区二区三区忘忧草 | 亚洲另类视频 | 日韩在线视频精品 | 亚洲不卡在线观看 | 国产一级片久久久 | 亚洲一区二区三区免费观看 | 国产精品日本一区二区不卡视频 | 在线视频 亚洲 | 99pao成人国产永久免费视频 | 大象视频一区二区 | 天堂一区| 日韩精品一二三 | 欧美精品三区 | 日韩国产黄色片 |