Skip to content

Commit

Permalink
Merge pull request #224 from designbymind/master
Browse files Browse the repository at this point in the history
iOS: Add scrollEnabled & zoomEnabled properties/methods
  • Loading branch information
hansemannn authored May 3, 2018
2 parents bd067bf + 37aea4e commit 5c6d3c7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apidoc/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,15 @@ properties:
type: Boolean
since: "3.2.0"
platforms: [iphone, ipad]

- name: scrollEnabled
summary: A Boolean value indicating whether the map can be scrolled by dragging gesture.
description: |
When this property is set to `true` the a map view can be panned or scrolled by dragging the map view.
type: Boolean
default: true
since: "7.2.0"
platforms: [iphone, ipad]

- name: showsBuildings
summary: A Boolean indicating whether the map displays extruded building information.
Expand Down Expand Up @@ -819,6 +828,17 @@ properties:
since: "6.1.0"
platforms: [android]

- name: zoomEnabled
summary: A Boolean value indicating whether the map can be zoomed by pinching or tapping.
description: |
When this property is set to `true` the a map view can be zoomed by pinching inwards to zoom out
and reverse to zoom in. Zooming in can also be accoplished by double-tapping the map view. Zooming
out can also be accomplished by two-finger tapping the map view.
type: Boolean
default: true
since: "7.2.0"
platforms: [iphone, ipad]

---
name: MapRegionTypev2
summary: Simple object representing a map location and zoom level.
Expand Down
16 changes: 16 additions & 0 deletions ios/Classes/TiMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,22 @@ - (void)setRotateEnabled_:(id)value
YES);
}

- (void)setScrollEnabled_:(id)value
{
TiThreadPerformOnMainThread(^{
[self map].scrollEnabled = [TiUtils boolValue:value];
},
YES);
}

- (void)setZoomEnabled_:(id)value
{
TiThreadPerformOnMainThread(^{
[self map].zoomEnabled = [TiUtils boolValue:value];
},
YES);
}

- (void)setShowsBuildings_:(id)value
{
TiThreadPerformOnMainThread(^{
Expand Down

0 comments on commit 5c6d3c7

Please sign in to comment.