DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > Appropriate Use of MapKit

Appropriate Use of MapKit

Peter Friese user avatar by
Peter Friese
·
Feb. 17, 11 · Mobile Zone · Interview
Like (0)
Save
Tweet
2.41K Views

Join the DZone community and get the full member experience.

Join For Free

I just had an app rejected because of violation of the Google Maps terms of service. While it certainly is kind of funny Apple rejects an app because you're violating Google's terms of service, I was wondering what in particular was wrong. At first sight, everything looked OK. Have a look at the following screenshot. It clearly violates Google's terms of service for Maps, but can you spot what is wrong?

Google Maps in your app - without Google Logo: you're doing it wrong!

What's wrong with this map?

Maybe you can better see what's wrong when I show you another screenshot, this time obeying the TOS:

Google Maps with logo: well done!

With logo: well done!

Can you spot the difference? It's the Google logo!

The reason why it is not shown in the first screenshot is that the bounds for the map are not set correctly. In the offending version of my app, I used a piece of code similar to this one:

- (void)viewDidLoad {
  [super viewDidLoad];
  mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
 
  mapView.showsUserLocation=TRUE;
  mapView.mapType=MKMapTypeStandard;
  [self.view addSubview:mapView];
}

Nothing wrong with it, but it lacks one essential line:

 
- (void)viewDidLoad {
  [super viewDidLoad];
  mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
 
  mapView.autoresizingMask =
    (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);	
 
  mapView.showsUserLocation=TRUE;
  mapView.mapType=MKMapTypeStandard;
  [self.view addSubview:mapView];
}

So, next time you write an app that contains Google Maps, make sure the Google logo is visible. You can get the full source code for this example on my GitHub page.

 

From http://www.peterfriese.de/appropriate-use-of-mapkit/

app Google (verb) Google Maps Logo (programming language) GitHub IT

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Migrating From Heroku To Render
  • Upsert in SQL: What Is an Upsert, and When Should You Use One?
  • Why Performance Projects Fail
  • Cloud-Based Integrations vs. On-Premise Models

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo