Permalink
Browse files

Updated README

  • Loading branch information...
1 parent 603c431 commit b7e407a09befcbbbf894477669c274d42c3c513d @weibel committed Aug 22, 2012
Showing with 45 additions and 3 deletions.
  1. +45 −3 README.md
View
@@ -1,9 +1,9 @@
MapKitWrapper
=============
-This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painfull
+This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painful.
-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.
+MapKitWrapper is work in progress. 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
```ruby
@@ -33,8 +33,50 @@ def loadView
# map.set_region(region, :animated => true)
map.showsUserLocation = true
self.view.addSubview(map)
+ map.set_zoom_level = 3
end
-```
+```
+
+## Wrappers for the Core Location Data Types
+
+Include the classes
+```ruby
+include CoreLocation::DataTypes
+```
+
+### LocationCoordinate: The wrapper for CLLocationCoordinate2D
+
+The `LocationCoordinate` initializer takes a variety of argument types
+```ruby
+LocationCoordinate.new(1,2)
+LocationCoordinate.new([1,2])
+LocationCoordinate.new(LocationCoordinate)
+LocationCoordinate.new(CLLocationCoordinate2D)
+```
+
+Methods on `LocationCoordinate`
+```ruby
+>> lc = LocationCoordinate.new(1,2)
+=> [1, 2]
+
+>> lc.latitude
+=> 1
+>> lc.latitude = 10
+=> 10
+
+>> lc.longitude
+=> 2
+>> lc.longitude = 15
+=> 15
+
+>> lc.to_array
+=> [10, 15]
+
+>> lc.sdk
+=> CLLocationCoordinate2D
+```
+
+
Check if the users location has been found
```ruby
@map.user_located?

0 comments on commit b7e407a

Please sign in to comment.