Android-------Gold Map Two-point route and multi-point route drawing

Source: Internet
Author: User

Recently friends need two point route and multi-point route to draw this function, help to get a bit, write this blog to share with you.

Two-point Route

Is the beginning and the end of the two latitude and longitude points, gold draw the route, you can achieve the solid line and dashed function

Related properties:

        New polylineoptions ();        Mpolylineoptions.setdottedline (true); // sets whether to be dashed        Mpolylineoptions.geodesic (false); // whether it is a geodetic curve        Mpolylineoptions.visible (true); // whether the segment is visible        Mpolylineoptions.usegradient (false); // Set whether a segment uses gradient        colors // Set Line color, width        Mpolylineoptions.color (Getwalkcolor ()). Width (getroutewidth ());

Multi-point Route

This can be used to record a walking trajectory, and to draw a route in countless coordinates.

: (I measured 10 points)

Related code:

        //start position and map interface size controlAmap.movecamera (Cameraupdatefactory.newlatlngzoom (list.get (0), 7)); Amap.setmaptextzindex (2);Amap.addpolyline ((Newpolylineoptions ())//Manual Data Testing//. 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)) //Collection Data. AddAll (list)//the width of the line. Width (setdottedline) (true). Geodesic (true)                //Color. Color (Color.argb (255,255,20,147)));

Source Address Download: Https://github.com/DickyQie/android-gaode-map

Android-------Gold Map Two-point route and multi-point route drawing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.