Add map type property (standard, satellite, hybrid) to MapView.

Summary:
Here is an example project demonstrating this pull request: [AKMapView](https://github.com/adamkrell/AKMapView)
Closes https://github.com/facebook/react-native/pull/1503
Github Author: Adam Krell <akrell@bethanyassociates.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
Adam Krell 2015-06-11 10:46:28 -07:00
parent ae9e4089fc
commit 04b3b52726
4 changed files with 21 additions and 0 deletions

View File

@ -82,6 +82,19 @@ var MapView = React.createClass({
*/
scrollEnabled: React.PropTypes.bool,
/**
* The map type to be displayed.
*
* - standard: standard road map (default)
* - satellite: satellite view
* - hybrid: satellite view with roads and points of interest overlayed
*/
mapType: React.PropTypes.oneOf([
'standard',
'satellite',
'hybrid',
]),
/**
* The region to be displayed by the map.
*

View File

@ -15,6 +15,7 @@
+ (MKCoordinateSpan)MKCoordinateSpan:(id)json;
+ (MKCoordinateRegion)MKCoordinateRegion:(id)json;
+ (MKShape *)MKShape:(id)json;
+ (MKMapType)MKMapType:(id)json;
typedef NSArray MKShapeArray;
+ (MKShapeArray *)MKShapeArray:(id)json;

View File

@ -43,4 +43,10 @@
RCT_ARRAY_CONVERTER(MKShape)
RCT_ENUM_CONVERTER(MKMapType, (@{
@"standard": @(MKMapTypeStandard),
@"satellite": @(MKMapTypeSatellite),
@"hybrid": @(MKMapTypeHybrid),
}), MKMapTypeStandard, integerValue)
@end

View File

@ -41,6 +41,7 @@ RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(maxDelta, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(minDelta, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(legalLabelInsets, UIEdgeInsets)
RCT_EXPORT_VIEW_PROPERTY(mapType, MKMapType)
RCT_EXPORT_VIEW_PROPERTY(annotations, MKShapeArray)
RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
{