Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default MkMapView Region

Please tell me what is the default map location when it simply add to the view. I added mapview like this

MKMapView *mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0,  self.searchBar.frame.size.height, 320, 180)];

mapView.mapType=MKMapTypeStandard;

mapView.delegate=self; 

[self.view addSubview:mapView];

what location will show on map ?

Is this according to device coordinates or by other

Thanks

like image 538
user100 Avatar asked Mar 13 '26 04:03

user100


2 Answers

After done so googling and reading apple map doc.

I found the solution the default location is the device local that is International in Settings -> general ->International->ResionFormat-> select your country.

map will focus according to this setting.

like image 125
user100 Avatar answered Mar 15 '26 17:03

user100


I think the system makes a call and Apple's servers return this info.

I've made a little test with simulator (Extra info: I'm in Spain):

  • Test 1

    1. Turn off internet access
    2. iOS simulator > Reset content and settings
    3. Build and run app w/mapview
    4. Turn on internet access
    5. Little scroll on map (just for change region a little and begin with map tiles downloading)
    6. United states is being displayed on screen
  • Test 2 (wihtout turning off internet)

    1. iOS simulator > Reset content and settings
    2. Build and run app w/mapview
    3. Spain is being displayed on screen

I don't think that Apple's getting user location without consent. It could be a request for default location IP based as a part of operative system.

like image 41
Hardschool Avatar answered Mar 15 '26 17:03

Hardschool