iOS Gold map to let the specified area or point appear in the middle of the screen

Source: Internet
Author: User

For the high-tech map is also a novice, a lot of features to see the document, ask the technical or the group number: 204668425

In our need to draw a circular polyline irregular graphics mode, open the map specified by the drawing to the middle of the screen

1. First create an array--arrayspace

Circle: You need to calculate the vertical four according to the RADIUS center point of the Circle

//Add all the dots to the circle//set the point of the locationCllocationcoordinate2d destinationcoordinated =Cllocationcoordinate2dmake (latitude,longitude); Mapointannotation* a1=[[Mapointannotation alloc] init]; A1.coordinate=destinationcoordinated; //111000 This is the maximum scale of the meter conversion latitude and longitude, so the calculated points will only be outside the circle                DoubleJingwei = (Double) arearadius/111000; //count into a central point[Arrayspace ADDOBJECT:A1]; //four points up and down from the Origin .                 for(intI=0; i<4; i++) {mapointannotation* a1=[[Mapointannotation alloc] init]; Switch(i) { Case 0: NSLog (@"%LF----%LF", latitude+jingwei,longitude+Jingwei); A1.coordinate= Cllocationcoordinate2dmake (latitude+jingwei,longitude);  Break;  Case 1: A1.coordinate= Cllocationcoordinate2dmake (latitude-jingwei,longitude);  Break;  Case 2: A1.coordinate= Cllocationcoordinate2dmake (latitude,longitude+Jingwei);  Break;  Case 3: A1.coordinate= Cllocationcoordinate2dmake (latitude,longitude-Jingwei);  Break; default:                             Break; }                                                            //adding arrays[Arrayspace ADDOBJECT:A1]; }
calculate Four Points

2, polyline, polygon join All points---"arrayspace

3, use the method below to control the size displayed in the screen

Add as a point

[self. Mapview showannotations:self. Arrayspace edgepadding:Uiedgeinsetsmake ($, £) Animated:YES];

Add by drawing a diagram

Self.mapview showoverlays:<# (Nsarray *) #> edgepadding:<# (uiedgeinsets) #> animated:<# (BOOL) #>

iOS Gold map to let the specified area or point appear in the middle of the screen

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.