Mapkit frames in iOS use the display of maps

Source: Internet
Author: User

1. Import the main header file #import <MapKit/MapKit.h>

Mapkit Framework usage notes the prefix for all data types in the Mapkit framework is MK

Mapkit has a more important UI control: Mkmapview, specifically for map display

2.

Set the Usertrackingmode property of Mkmapview to track the current location of the user

Mkusertrackingmodenone: Do not track the user's location

Mkusertrackingmodefollow: Tracks and displays the user's current location on the map mkusertrackingmodefollowwithheading: tracks and displays the user's current location on the map, which rotates with the user's forward direction

3.

You can set the map type by setting the Mapviewtype of Mkmapview

Mkmaptypestandard: General map (left)

Mkmaptypesatellite: Satellite cloud Image (Central)

Mkmaptypehybrid: General map over satellite cloud image (right)

4.

Mkmapview can set a proxy object that is used to listen to the map's related behavior common proxy methods are

-(void) Mapview: (Mkmapview *) Mapview didupdateuserlocation: (mkuserlocation *) userlocation;

A location change will be called only once, constantly monitoring the user's current location every time the call, will be the user's latest location (userlocation parameter) passed in

-(void) Mapview: (Mkmapview *) Mapview regionwillchangeanimated: (BOOL) animated;

Called when the map's display area is about to change

-(void) Mapview: (Mkmapview *) Mapview regiondidchangeanimated: (BOOL) animated;

Called when the display area of the map has changed

Mkuserlocation is actually a PIN model that includes the following properties

@property (nonatomic, copy) NSString *title;

Title displayed on the Pin

@property (nonatomic, copy) NSString *subtitle;

Sub-headings displayed on a PIN

@property (readonly, nonatomic) cllocation *location;

Location information (where are the pins pinned?)

Mapkit frames in iOS use the display of maps

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.