Class: MapKit::MapType

Inherits:
Object
  • Object
show all
Defined in:
lib/map-kit-wrapper/map_type.rb

Overview

Class for dealing with MKMapView map type constants

Class Method Summary collapse

Class Method Details

.mkmap_to_rmap(map_type) ⇒ Object

Convert from MKMapView to MapView

  • Args :

    • map_type -> Map type as MKMapView constant

  • Returns :

    • map type as symbol



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/map-kit-wrapper/map_type.rb', line 20

def self.mkmap_to_rmap(map_type)
  case map_type
    when MKMapTypeStandard
      :standard
    when MKMapTypeSatellite
      :satellite
    when MKMapTypeHybrid
      :hybrid
    else
      raise "Unknown map type: #{map_type.inspect}"
  end
end

.rmap_to_mkmap(map_type) ⇒ Object

Convert from MapView to MKMapView

  • Args :

    • map_type -> Map type as symbol

  • Returns :

    • Map type as MKMapView constant



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/map-kit-wrapper/map_type.rb', line 42

def self.rmap_to_mkmap(map_type)
  case map_type
    when :standard
      MKMapTypeStandard
    when :satellite
      MKMapTypeSatellite
    when :hybrid
      MKMapTypeHybrid
    else
      raise "Unknown map type: #{map_type.inspect}"
  end
end