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