Table of Content

A MapKit implementation compatible to AppKit


MapKit is a API to provide a MKMapView which shows a section of the world map.

Apple provides MKMapKit only on iOS and it is a subview of UIView which is part of UIKit.

Our implementation tries to follow the API as good as possible but makes it a subview of NSView which is defined by AppKit.

While Apple provides Google Maps (Satellite and Map images) we use the MapNik tiles of OpenStreetMap as the image source.

The user location can be shown through CLLocation


Key and mouse shortcuts

If scrolling and/or zoom is enabled the user can pan (scroll) through the map and zoom in and out.

The definitions are:

  • left arrow: move west
  • right arrow: move east
  • up arrow: move north
  • down: move south
  • alt-left arrow: zoom out
  • alt-right arrow: zoom in
  • alt-up arrow: zoom out
  • alt-down arrow: zoom in
  • scroll left/right: move west/east
  • scroll up/down: move north/south
  • click and drag: make view follow mouse
  • double click: choose as center and zoom in
  • alt-double click: zoom out

choosing the visible area

You can use any of the following methods:

-[map setCenterLocation:]
-[map setVisibleMapRect:]
-[map setRegion:]

Map rotation

The map can easily be rotated by user code (e.g. in a location or heading update delegate) by calling

[mapView setBoundsRotation:degrees]

Created: 13 years 1 day ago
by Nikolaus Schaller

Updated: 11 years 10 months ago
by Nikolaus Schaller

Old Revisions