Android study note 11

Source: Internet
Author: User

Google map:
Mapactivity
Mapview
Listactivity
Add permission
Add the following content to the activity Tag: <uses-library Android: Name = "com. Google. Android. Maps"/>

Extends mapactivity, add the mapview component, and add network permissions to manifest.
<Uses-Permission Android: Name = "android. Permission. Internet"/> and add
<Uses-library Android: Name = "com. Google. Android. Maps"/>
Display the most basic map

Zoom
Sub-District

Knowledge point:
Create a mapcontroller object: getcontroller () setzone (5) Scaling Method of the mapview object
Map Display Method: settraffic (true) of mapview traffic setsatellite (true) satellite setstreetveiw (false) Sub-District

GPS positioning:
Class used: locationmanager = getsystemservice (context. location_service );
Locationlistener. requestlocationupdates (string provider, long mintime, float mindistance,
Locationlistener) is used to add listeners.
The provider is the location provider, and the enumerated type is the locationmanager constant.
Mintime minimum listening Interval
Mindistance update details
Listener location listener, override a callback function

Change location method:
Animateto (geopoint point)
In the requestlocationupdates method, after obtaining the latitude and longitude, convert it to a geopoint object. For example:
Geopoint gpoint = new geopoint (INT) (location. getaltitude () * 1e6 ),
(INT) (location. getlongpolling () * 1e6 ));
Mapcontroller. animateto (gpoint );

Telnet localhost 5554 in cmd

Map movement:
Mapview. getmapcenter (). getlongitudee6 () // longitude
Mapview. getmapcenter (). getlatitudee6 () // latitude

Getlatitudspan () // screen latitude gap


Drag the map with the mouse touch:
Override ontouchevent (motionevent event)
Use the projection class for projection and operations


Drawing on a map:
Drawing Class: Layout class android. Graphics. Canvas
Paint class android. Graphics. Paint
Android. Graphics. Point
Painting area Android. Graphics. rectf
Paint style Android. Graphics. Paint. Style

Convert overlay to mapview Service

GPS Positioning {tracking }:
Processing of multiple overlay itemizedoverlay
Overlayitem

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.