按類重疊並從該類調用onTap方法我可以在我的地圖上顯示drawable。我想要做的事情只是當用戶點擊地圖時(第一個水龍頭)顯示一個可繪製的圖標,而不是通過點擊一次又一次顯示在不同的地方繪製。這可能嗎?在地圖上僅顯示一次可點按
0
A
回答
0
override you onTap() method of Overlay
@Override
protected boolean onTap(int index) {
Drawable srcdrawable = getApplicationContext().getResources().getDrawable(R.drawable.pin_blue);
CustomItemizedOverlay srcitemizedOverlay = new CustomItemizedOverlay(srcdrawable, getApplicationContext());
forloop(setoflocations){
GeoPoint srcpoint = new GeoPoint((int)(Double.parseDouble(lat) * 1E6),(int)(//latitude and longitude of user tapped location...
Double.parseDouble(lng)* 1E6));
OverlayItem srcoverlayitem = new OverlayItem(srcpoint, "Hello!", "This is your Location.");
if(srcitemizedOverlay!=null && mapController!=null){
srcitemizedOverlay.addOverlay(overlayitem);
mapController.animateTo(point);
animatePoint = point;
}
}
mapView.getOverlays().clear();
mapView.getOverlays().add(srcitemizedOverlay);
// pop up a alert dialog here and ask user for confirmation
}
相關問題
- 1. WPF按鈕圖像僅顯示在上次控件中
- 2. RecyclerView內的MapView僅在點擊上顯示地圖
- 3. jQuery - 在鍵盤上僅顯示一次加載圖像
- 4. 僅在主要地圖上才顯示Google地圖標記
- 5. 顯示消息僅一次
- 6. 彈出顯示僅一次
- 7. Simplemodal Google地圖只顯示一次,但不顯示第二次點擊
- 8. 在節點上顯示OpenLayers地圖
- 9. 服務在地圖上顯示點android
- 10. Google Maps API v2僅在一臺設備上顯示地圖
- 11. Google地圖不顯示(點擊按鈕)
- 12. 顯示谷歌地圖,點擊按鈕
- 13. 事件僅在第一次加載時顯示,而不是在點擊下一頁或上一頁後顯示
- 14. 如何在Android地圖上顯示小的可點擊項目
- 15. 如何僅在地圖的可視區域顯示圖釘
- 16. jQuery Ui datepicker僅在第一次點擊時顯示
- 17. 僅在移動地圖時顯示MKPolyline
- 18. 點擊按鈕點擊事件傳遞經緯度對應在谷歌地圖上顯示的地方顯示
- 19. 在Android谷歌地圖v2中僅使標記點擊一次
- 20. 僅當在Xcode中單擊按鈕時才顯示地圖
- 21. Gviz僅顯示Google地圖上融合表的第一部分
- 22. 地圖infoWindow不會顯示從第一次點擊
- 23. 點擊圖片顯示上傳按鈕
- 24. Matlab一次僅顯示一個窗口
- 25. 在按鈕上點擊顯示一系列圖像
- 26. 在谷歌地圖中僅顯示當前用戶位置一次
- 27. 在谷歌地圖上顯示一個點周圍的針腳
- 28. 如何在地圖顯示時在地圖上顯示氣球?
- 29. 「箭頭」圖片僅在OpenLayers地圖中顯示一半3
- 30. Javascript Exif信息僅在html頁面中第一次點擊圖片後顯示
任何代碼?配置?截圖?即使對問題的恰當解釋? – Alpay
我編輯了這個問題。我希望現在更好.. – Blubar