Simple traffic map of Android Google Maps (1)

Source: Internet
Author: User
Tags polyline

Through several learning articles, we can easily locate the problem in Android 2.3.3 and later versions ~~~~ Thank you for your valuable suggestions ~~~

1. Source Code: In the previous project (that is, the project of the previous article, in order to avoid multiple requests for the API key value, after applying for an API key value, therefore, subsequent activities are stored in the same API.
Under the corresponding package of the key, other configurations are put in the same project, so if you are not clear, you can first look at the previous articles about Android Google map by cainiao, however, it is quite practical ~~~) Create a lineactivity, so the source code only provides the lineactivity part. If you like android, you can try to see the article before cainiao ~~~)

 

Modify the activity in the mainfest file ~~~ For example:


2. Running result:


3. Simple code parsing:

Polyline defines a group of connected line segments on the map. A line object consists of a group of longitude and latitude positions, and a series of line segments are established in an ordered sequence to connect these locations. To create a polyline, you must first create a polylineoptions
Objects, which are added to polylineoptions in the order of line between points. To add a vertex to polylineoptions, call polylineoptions. Add (). GoogleMap. addpolyline (polylineoptions) adds polylineoptions to GoogleMap.

After reading this article, you can visit http://blog.csdn.net/woshishuoshuoa/article/details/9830813oh ~~~

Related Article

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.