MapKitWrapper for RubyMotion
Ruby
Pull request Compare This branch is 1 commit ahead, 46 commits behind weibel:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.DS_Store
.gitignore
Gemfile
LICENSE
README.md
Rakefile
map_kit_wrapper.gemspec

README.md

MapKitWrapper

This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painfull

It is still work in progress, but right now there are wrappers for the Map Kit Data Types and the Core Location Data Types. Those will save you a lot of typing.

Installation

gem install map-kit-wrapper

Setup

Edit the Rakefile of your RubyMotion project and add the following require line.

# use underscores for now
require 'map_kit_wrapper'

Example

def loadView
  self.view = UIView.alloc.initWithFrame(tabBarController.view.bounds)
  map = MapView.new
  map.frame = self.view.frame
  map.delegate = self
  region = CoordinateRegion.new([56, 10.6], [3.1, 3.1])
  map.region = region
  # Alternatively use set_region
  # map.set_region(region, :animated => true)
  map.showsUserLocation = true
  self.view.addSubview(map)
end

Check if the users location has been found

@map.user_located?

Get the users coordinates

@map.user_coordinates