android-------高德地圖兩點路線和多個點路線繪製

來源:互聯網
上載者:User

標籤:size   tar   10個   idt   img   tps   gradient   use   log   

最近朋友需要兩點路線和多個點路線繪製這個功能,幫忙弄了一下,寫這篇部落格與大家分享一下。

兩點路線

是起點和終點兩個經緯度點,高德繪製出路線,可以實現實線和虛線功能

      

 

相關屬性:

 

        mPolylineOptions = new PolylineOptions();        mPolylineOptions.setDottedLine(true);//設定是否為虛線        mPolylineOptions.geodesic(false);//是否為大地曲線        mPolylineOptions.visible(true);//線段是否可見        mPolylineOptions.useGradient(false);//設定線段是否使用漸層色        //設定線顏色,寬度        mPolylineOptions.color(getWalkColor()).width(getRouteWidth());

 

 

 

 

 

多點路線

這個可以用來記錄行走軌跡,無數個座標點繪製路線

:(我測了10個點)

  

 

 

相關代碼:

 

        //起點位置和  地圖介面大小控制        aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(list.get(0), 7));        aMap.setMapTextZIndex(2);        aMap.addPolyline((new PolylineOptions())                //手動資料測試                //.add(new LatLng(26.57, 106.71),new LatLng(26.14,105.55),new LatLng(26.58, 104.82), new LatLng(30.67, 104.06))                //集合資料                .addAll(list)                //線的寬度                .width(10).setDottedLine(true).geodesic(true)                //顏色                .color(Color.argb(255,255,20,147)));

 

 

 

 

 

源碼地址下載:https://github.com/DickyQie/android-gaode-map

 

 

 

 

android-------高德地圖兩點路線和多個點路線繪製

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.