簡體   English   中英

Android Google Maps V2如何在地圖上繪制自定義視圖(1/3實心圓),在哪里可以繪制畫布對象

[英]Android Google maps V2 How to draw a Custom Views(1/3 filled circle) on map where can i get canvas object to draw

Android Google Maps V2如何在地圖上繪制自定義視圖(1/3實心圓),在哪里可以繪制畫布對象。由於所有新類都是最終類,因此無法對其進行擴展。

我需要在地圖上繪制一些局部視圖。我從v1升級到v2.Overlays已被棄用。我嘗試使用Tile Provider,但它沒有繪制任何內容。

exampleButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GroundOverlayOptions overlayOptions = new GroundOverlayOptions()
                        .image(BitmapDescriptorFactory.fromResource(R.drawable.testImage))
                        .position(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), 8600f, 6500f);
                map.addGroundOverlay(overlayOptions);
            }
        });

這是用於在指定緯度上繪制圖像的代碼,該圖像適用於Google Maps v2。 您基本上可以得到1/3實心圓的圖像並將其設置為所需的經度。

希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM