Move iOS Maps out of the GitHub repo to internal fb codebase
Summary: MapView has been deprecated in open source for a while: http://facebook.github.io/react-native/docs/mapview.html We still want to use it internally. Moving it away from the GitHub folder. Reviewed By: mmmulani Differential Revision: D4646199 fbshipit-source-id: f469971e448dbca12afe141b43fa8a2518c7d467
This commit is contained in:
parent
adf650debc
commit
48f30eca7e
|
@ -1,473 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* The examples provided by Facebook are for non-commercial testing and
|
||||
* evaluation purposes only.
|
||||
*
|
||||
* Facebook reserves all rights not expressly granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
|
||||
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* @flow
|
||||
* @providesModule MapViewExample
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var { PropTypes } = React;
|
||||
var {
|
||||
Image,
|
||||
MapView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextInput,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} = ReactNative;
|
||||
|
||||
var regionText = {
|
||||
latitude: '0',
|
||||
longitude: '0',
|
||||
latitudeDelta: '0',
|
||||
longitudeDelta: '0',
|
||||
};
|
||||
|
||||
var MapRegionInput = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
region: PropTypes.shape({
|
||||
latitude: PropTypes.number.isRequired,
|
||||
longitude: PropTypes.number.isRequired,
|
||||
latitudeDelta: PropTypes.number,
|
||||
longitudeDelta: PropTypes.number,
|
||||
}),
|
||||
onChange: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
return {
|
||||
region: {
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
this.setState({
|
||||
region: nextProps.region || this.getInitialState().region
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var region = this.state.region || this.getInitialState().region;
|
||||
return (
|
||||
<View>
|
||||
<View style={styles.row}>
|
||||
<Text>
|
||||
{'Latitude'}
|
||||
</Text>
|
||||
<TextInput
|
||||
value={'' + region.latitude}
|
||||
style={styles.textInput}
|
||||
onChange={this._onChangeLatitude}
|
||||
selectTextOnFocus={true}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.row}>
|
||||
<Text>
|
||||
{'Longitude'}
|
||||
</Text>
|
||||
<TextInput
|
||||
value={'' + region.longitude}
|
||||
style={styles.textInput}
|
||||
onChange={this._onChangeLongitude}
|
||||
selectTextOnFocus={true}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.row}>
|
||||
<Text>
|
||||
{'Latitude delta'}
|
||||
</Text>
|
||||
<TextInput
|
||||
value={
|
||||
region.latitudeDelta == null ? '' : String(region.latitudeDelta)
|
||||
}
|
||||
style={styles.textInput}
|
||||
onChange={this._onChangeLatitudeDelta}
|
||||
selectTextOnFocus={true}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.row}>
|
||||
<Text>
|
||||
{'Longitude delta'}
|
||||
</Text>
|
||||
<TextInput
|
||||
value={
|
||||
region.longitudeDelta == null ? '' : String(region.longitudeDelta)
|
||||
}
|
||||
style={styles.textInput}
|
||||
onChange={this._onChangeLongitudeDelta}
|
||||
selectTextOnFocus={true}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.changeButton}>
|
||||
<Text onPress={this._change}>
|
||||
{'Change'}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
},
|
||||
|
||||
_onChangeLatitude: function(e) {
|
||||
regionText.latitude = e.nativeEvent.text;
|
||||
},
|
||||
|
||||
_onChangeLongitude: function(e) {
|
||||
regionText.longitude = e.nativeEvent.text;
|
||||
},
|
||||
|
||||
_onChangeLatitudeDelta: function(e) {
|
||||
regionText.latitudeDelta = e.nativeEvent.text;
|
||||
},
|
||||
|
||||
_onChangeLongitudeDelta: function(e) {
|
||||
regionText.longitudeDelta = e.nativeEvent.text;
|
||||
},
|
||||
|
||||
_change: function() {
|
||||
this.setState({
|
||||
region: {
|
||||
latitude: parseFloat(regionText.latitude),
|
||||
longitude: parseFloat(regionText.longitude),
|
||||
latitudeDelta: parseFloat(regionText.latitudeDelta),
|
||||
longitudeDelta: parseFloat(regionText.longitudeDelta),
|
||||
},
|
||||
});
|
||||
this.props.onChange(this.state.region);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
class MapViewExample extends React.Component {
|
||||
state = {
|
||||
isFirstLoad: true,
|
||||
mapRegion: undefined,
|
||||
mapRegionInput: undefined,
|
||||
annotations: [],
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<MapView
|
||||
style={styles.map}
|
||||
onRegionChange={this._onRegionChange}
|
||||
onRegionChangeComplete={this._onRegionChangeComplete}
|
||||
region={this.state.mapRegion}
|
||||
annotations={this.state.annotations}
|
||||
/>
|
||||
<MapRegionInput
|
||||
onChange={this._onRegionInputChanged}
|
||||
region={this.state.mapRegionInput}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
_getAnnotations = (region) => {
|
||||
return [{
|
||||
longitude: region.longitude,
|
||||
latitude: region.latitude,
|
||||
title: 'You Are Here',
|
||||
}];
|
||||
};
|
||||
|
||||
_onRegionChange = (region) => {
|
||||
this.setState({
|
||||
mapRegionInput: region,
|
||||
});
|
||||
};
|
||||
|
||||
_onRegionChangeComplete = (region) => {
|
||||
if (this.state.isFirstLoad) {
|
||||
this.setState({
|
||||
mapRegionInput: region,
|
||||
annotations: this._getAnnotations(region),
|
||||
isFirstLoad: false,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_onRegionInputChanged = (region) => {
|
||||
this.setState({
|
||||
mapRegion: region,
|
||||
mapRegionInput: region,
|
||||
annotations: this._getAnnotations(region),
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
class AnnotationExample extends React.Component {
|
||||
state = {
|
||||
isFirstLoad: true,
|
||||
annotations: [],
|
||||
mapRegion: undefined,
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.state.isFirstLoad) {
|
||||
var onRegionChangeComplete = (region) => {
|
||||
this.setState({
|
||||
isFirstLoad: false,
|
||||
annotations: [{
|
||||
longitude: region.longitude,
|
||||
latitude: region.latitude,
|
||||
...this.props.annotation,
|
||||
}],
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<MapView
|
||||
showsAnnotationCallouts={this.props.showsAnnotationCallouts}
|
||||
style={styles.map}
|
||||
onRegionChangeComplete={onRegionChangeComplete}
|
||||
region={this.state.mapRegion}
|
||||
annotations={this.state.annotations}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DraggableAnnotationExample extends React.Component {
|
||||
state = {
|
||||
isFirstLoad: true,
|
||||
annotations: [],
|
||||
mapRegion: undefined,
|
||||
};
|
||||
|
||||
createAnnotation = (longitude, latitude) => {
|
||||
return {
|
||||
longitude,
|
||||
latitude,
|
||||
draggable: true,
|
||||
onDragStateChange: (event) => {
|
||||
if (event.state === 'idle') {
|
||||
this.setState({
|
||||
annotations: [this.createAnnotation(event.longitude, event.latitude)],
|
||||
});
|
||||
}
|
||||
console.log('Drag state: ' + event.state);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.state.isFirstLoad) {
|
||||
var onRegionChangeComplete = (region) => {
|
||||
//When the MapView loads for the first time, we can create the annotation at the
|
||||
//region that was loaded.
|
||||
this.setState({
|
||||
isFirstLoad: false,
|
||||
annotations: [this.createAnnotation(region.longitude, region.latitude)],
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<MapView
|
||||
style={styles.map}
|
||||
onRegionChangeComplete={onRegionChangeComplete}
|
||||
region={this.state.mapRegion}
|
||||
annotations={this.state.annotations}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
map: {
|
||||
height: 150,
|
||||
margin: 10,
|
||||
borderWidth: 1,
|
||||
borderColor: '#000000',
|
||||
},
|
||||
row: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
textInput: {
|
||||
width: 150,
|
||||
height: 20,
|
||||
borderWidth: 0.5,
|
||||
borderColor: '#aaaaaa',
|
||||
fontSize: 13,
|
||||
padding: 4,
|
||||
},
|
||||
changeButton: {
|
||||
alignSelf: 'center',
|
||||
marginTop: 5,
|
||||
padding: 3,
|
||||
borderWidth: 0.5,
|
||||
borderColor: '#777777',
|
||||
},
|
||||
});
|
||||
|
||||
exports.displayName = (undefined: ?string);
|
||||
exports.title = '<MapView>';
|
||||
exports.description = 'Base component to display maps';
|
||||
exports.examples = [
|
||||
{
|
||||
title: 'Map',
|
||||
render() {
|
||||
return <MapViewExample />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'showsUserLocation + followUserLocation',
|
||||
render() {
|
||||
return (
|
||||
<MapView
|
||||
style={styles.map}
|
||||
showsUserLocation={true}
|
||||
followUserLocation={true}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Callout example',
|
||||
render() {
|
||||
return <AnnotationExample style={styles.map} annotation={{
|
||||
title: 'More Info...',
|
||||
rightCalloutView: (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
alert('You Are Here');
|
||||
}}>
|
||||
<Image
|
||||
style={{width:30, height:30}}
|
||||
source={require('./uie_thumb_selected.png')}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
}}/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Show callouts by default example',
|
||||
render() {
|
||||
return <AnnotationExample
|
||||
style={styles.map}
|
||||
annotation={{
|
||||
title: 'More Info...',
|
||||
rightCalloutView: (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
alert('You Are Here');
|
||||
}}>
|
||||
<Image
|
||||
style={{width:30, height:30}}
|
||||
source={require('./uie_thumb_selected.png')}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
}}
|
||||
showsAnnotationCallouts={true}
|
||||
/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Annotation focus example',
|
||||
render() {
|
||||
return <AnnotationExample style={styles.map} annotation={{
|
||||
title: 'More Info...',
|
||||
onFocus: () => {
|
||||
alert('Annotation gets focus');
|
||||
},
|
||||
onBlur: () => {
|
||||
alert('Annotation lost focus');
|
||||
}
|
||||
}}/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Draggable pin',
|
||||
render() {
|
||||
return <DraggableAnnotationExample/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom pin color',
|
||||
render() {
|
||||
return <AnnotationExample style={styles.map} annotation={{
|
||||
title: 'You Are Purple',
|
||||
tintColor: MapView.PinColors.PURPLE,
|
||||
}}/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom pin image',
|
||||
render() {
|
||||
return <AnnotationExample style={styles.map} annotation={{
|
||||
title: 'Thumbs Up!',
|
||||
image: require('./uie_thumb_big.png'),
|
||||
}}/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom pin view',
|
||||
render() {
|
||||
return <AnnotationExample style={styles.map} annotation={{
|
||||
title: 'Thumbs Up!',
|
||||
view: <View style={{
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<Text style={{fontWeight: 'bold', color: '#f007'}}>
|
||||
Thumbs Up!
|
||||
</Text>
|
||||
<Image
|
||||
style={{width: 90, height: 65, resizeMode: 'cover'}}
|
||||
source={require('./uie_thumb_big.png')}
|
||||
/>
|
||||
</View>,
|
||||
}}/>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom overlay',
|
||||
render() {
|
||||
return <MapView
|
||||
style={styles.map}
|
||||
region={{
|
||||
latitude: 39.06,
|
||||
longitude: -95.22,
|
||||
}}
|
||||
overlays={[{
|
||||
coordinates:[
|
||||
{latitude: 32.47, longitude: -107.85},
|
||||
{latitude: 45.13, longitude: -94.48},
|
||||
{latitude: 39.27, longitude: -83.25},
|
||||
{latitude: 32.47, longitude: -107.85},
|
||||
],
|
||||
strokeColor: '#f007',
|
||||
lineWidth: 3,
|
||||
}]}
|
||||
/>;
|
||||
}
|
||||
},
|
||||
];
|
|
@ -80,11 +80,6 @@ const ComponentExamples: Array<UIExplorerExample> = [
|
|||
module: require('./ListViewPagingExample'),
|
||||
supportsTVOS: true,
|
||||
},
|
||||
{
|
||||
key: 'MapViewExample',
|
||||
module: require('./MapViewExample'),
|
||||
supportsTVOS: true,
|
||||
},
|
||||
{
|
||||
key: 'ModalExample',
|
||||
module: require('./ModalExample'),
|
||||
|
|
|
@ -1,565 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule MapView
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const ColorPropType = require('ColorPropType');
|
||||
const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
||||
const Image = require('Image');
|
||||
const NativeMethodsMixin = require('NativeMethodsMixin');
|
||||
const React = require('React');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const View = require('View');
|
||||
|
||||
const deprecatedPropType = require('deprecatedPropType');
|
||||
const processColor = require('processColor');
|
||||
const resolveAssetSource = require('resolveAssetSource');
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
type Event = Object;
|
||||
|
||||
/**
|
||||
* State of an annotation on the map.
|
||||
*/
|
||||
export type AnnotationDragState = $Enum<{
|
||||
/**
|
||||
* Annotation is not being touched.
|
||||
*/
|
||||
idle: string,
|
||||
/**
|
||||
* Annotation dragging has began.
|
||||
*/
|
||||
starting: string,
|
||||
/**
|
||||
* Annotation is being dragged.
|
||||
*/
|
||||
dragging: string,
|
||||
/**
|
||||
* Annotation dragging is being canceled.
|
||||
*/
|
||||
canceling: string,
|
||||
/**
|
||||
* Annotation dragging has ended.
|
||||
*/
|
||||
ending: string,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* **IMPORTANT: This component is now DEPRECATED and will be removed
|
||||
* in January 2017 (React Native version 0.42). This component only supports
|
||||
* iOS.**
|
||||
*
|
||||
* **Please use
|
||||
* [react-native-maps](https://github.com/airbnb/react-native-maps) by Airbnb
|
||||
* instead of this component.** Our friends at Airbnb have done an amazing job
|
||||
* building a cross-platform `MapView` component that is more feature
|
||||
* complete. It is used extensively (over 9k installs / month).
|
||||
*
|
||||
* `MapView` is used to display embeddable maps and annotations using
|
||||
* `MKMapView`.
|
||||
*
|
||||
* ```
|
||||
* import React, { Component } from 'react';
|
||||
* import { MapView } from 'react-native';
|
||||
*
|
||||
* class MapMyRide extends Component {
|
||||
* render() {
|
||||
* return (
|
||||
* <MapView
|
||||
* style={{height: 200, margin: 40}}
|
||||
* showsUserLocation={true}
|
||||
* />
|
||||
* );
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
|
||||
// $FlowFixMe(>=0.41.0)
|
||||
const MapView = React.createClass({
|
||||
|
||||
mixins: [NativeMethodsMixin],
|
||||
|
||||
propTypes: {
|
||||
...View.propTypes,
|
||||
/**
|
||||
* Used to style and layout the `MapView`.
|
||||
*/
|
||||
style: View.propTypes.style,
|
||||
|
||||
/**
|
||||
* If `true` the app will ask for the user's location and display it on
|
||||
* the map. Default value is `false`.
|
||||
*
|
||||
* **NOTE**: You'll need to add the `NSLocationWhenInUseUsageDescription`
|
||||
* key in Info.plist to enable geolocation, otherwise it will fail silently.
|
||||
*/
|
||||
showsUserLocation: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `true` the map will follow the user's location whenever it changes.
|
||||
* Note that this has no effect unless `showsUserLocation` is enabled.
|
||||
* Default value is `true`.
|
||||
*/
|
||||
followUserLocation: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `false` points of interest won't be displayed on the map.
|
||||
* Default value is `true`.
|
||||
*/
|
||||
showsPointsOfInterest: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `false`, compass won't be displayed on the map.
|
||||
* Default value is `true`.
|
||||
*/
|
||||
showsCompass: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `true` the map will show the callouts for all annotations without
|
||||
* the user having to click on the annotation.
|
||||
* Default value is `false`.
|
||||
*/
|
||||
showsAnnotationCallouts: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `false` the user won't be able to pinch/zoom the map.
|
||||
* Default value is `true`.
|
||||
*/
|
||||
zoomEnabled: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* When this property is set to `true` and a valid camera is associated with
|
||||
* the map, the camera's heading angle is used to rotate the plane of the
|
||||
* map around its center point.
|
||||
*
|
||||
* When this property is set to `false`, the
|
||||
* camera's heading angle is ignored and the map is always oriented so
|
||||
* that true north is situated at the top of the map view
|
||||
*/
|
||||
rotateEnabled: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* When this property is set to `true` and a valid camera is associated
|
||||
* with the map, the camera's pitch angle is used to tilt the plane
|
||||
* of the map.
|
||||
*
|
||||
* When this property is set to `false`, the camera's pitch
|
||||
* angle is ignored and the map is always displayed as if the user
|
||||
* is looking straight down onto it.
|
||||
*/
|
||||
pitchEnabled: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* If `false` the user won't be able to change the map region being displayed.
|
||||
* Default value is `true`.
|
||||
*/
|
||||
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 overlaid.
|
||||
*/
|
||||
mapType: React.PropTypes.oneOf([
|
||||
'standard',
|
||||
'satellite',
|
||||
'hybrid',
|
||||
]),
|
||||
|
||||
/**
|
||||
* The region to be displayed by the map.
|
||||
*
|
||||
* The region is defined by the center coordinates and the span of
|
||||
* coordinates to display.
|
||||
*/
|
||||
region: React.PropTypes.shape({
|
||||
/**
|
||||
* Coordinates for the center of the map.
|
||||
*/
|
||||
latitude: React.PropTypes.number.isRequired,
|
||||
longitude: React.PropTypes.number.isRequired,
|
||||
|
||||
/**
|
||||
* Distance between the minimum and the maximum latitude/longitude
|
||||
* to be displayed.
|
||||
*/
|
||||
latitudeDelta: React.PropTypes.number,
|
||||
longitudeDelta: React.PropTypes.number,
|
||||
}),
|
||||
|
||||
/**
|
||||
* Map annotations with title and subtitle.
|
||||
*/
|
||||
annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
|
||||
/**
|
||||
* The location of the annotation.
|
||||
*/
|
||||
latitude: React.PropTypes.number.isRequired,
|
||||
longitude: React.PropTypes.number.isRequired,
|
||||
|
||||
/**
|
||||
* Whether the pin drop should be animated or not
|
||||
*/
|
||||
animateDrop: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Whether the pin should be draggable or not
|
||||
*/
|
||||
draggable: React.PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Event that fires when the annotation drag state changes.
|
||||
*/
|
||||
onDragStateChange: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* Event that fires when the annotation gets was tapped by the user
|
||||
* and the callout view was displayed.
|
||||
*/
|
||||
onFocus: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* Event that fires when another annotation or the mapview itself
|
||||
* was tapped and a previously shown annotation will be closed.
|
||||
*/
|
||||
onBlur: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* Annotation title and subtile.
|
||||
*/
|
||||
title: React.PropTypes.string,
|
||||
subtitle: React.PropTypes.string,
|
||||
|
||||
/**
|
||||
* Callout views.
|
||||
*/
|
||||
leftCalloutView: React.PropTypes.element,
|
||||
rightCalloutView: React.PropTypes.element,
|
||||
detailCalloutView: React.PropTypes.element,
|
||||
|
||||
/**
|
||||
* The pin color. This can be any valid color string, or you can use one
|
||||
* of the predefined PinColors constants. Applies to both standard pins
|
||||
* and custom pin images.
|
||||
*
|
||||
* Note that on iOS 8 and earlier, only the standard PinColor constants
|
||||
* are supported for regular pins. For custom pin images, any tintColor
|
||||
* value is supported on all iOS versions.
|
||||
*/
|
||||
tintColor: ColorPropType,
|
||||
|
||||
/**
|
||||
* Custom pin image. This must be a static image resource inside the app.
|
||||
*/
|
||||
image: Image.propTypes.source,
|
||||
|
||||
/**
|
||||
* Custom pin view. If set, this replaces the pin or custom pin image.
|
||||
*/
|
||||
view: React.PropTypes.element,
|
||||
|
||||
/**
|
||||
* annotation id
|
||||
*/
|
||||
id: React.PropTypes.string,
|
||||
|
||||
/**
|
||||
* Deprecated. Use the left/right/detailsCalloutView props instead.
|
||||
*/
|
||||
hasLeftCallout: deprecatedPropType(
|
||||
React.PropTypes.bool,
|
||||
'Use `leftCalloutView` instead.'
|
||||
),
|
||||
hasRightCallout: deprecatedPropType(
|
||||
React.PropTypes.bool,
|
||||
'Use `rightCalloutView` instead.'
|
||||
),
|
||||
onLeftCalloutPress: deprecatedPropType(
|
||||
React.PropTypes.func,
|
||||
'Use `leftCalloutView` instead.'
|
||||
),
|
||||
onRightCalloutPress: deprecatedPropType(
|
||||
React.PropTypes.func,
|
||||
'Use `rightCalloutView` instead.'
|
||||
),
|
||||
})),
|
||||
|
||||
/**
|
||||
* Map overlays
|
||||
*/
|
||||
overlays: React.PropTypes.arrayOf(React.PropTypes.shape({
|
||||
/**
|
||||
* Polyline coordinates
|
||||
*/
|
||||
coordinates: React.PropTypes.arrayOf(React.PropTypes.shape({
|
||||
latitude: React.PropTypes.number.isRequired,
|
||||
longitude: React.PropTypes.number.isRequired
|
||||
})),
|
||||
|
||||
/**
|
||||
* Line attributes
|
||||
*/
|
||||
lineWidth: React.PropTypes.number,
|
||||
strokeColor: ColorPropType,
|
||||
fillColor: ColorPropType,
|
||||
|
||||
/**
|
||||
* Overlay id
|
||||
*/
|
||||
id: React.PropTypes.string
|
||||
})),
|
||||
|
||||
/**
|
||||
* Maximum size of the area that can be displayed.
|
||||
*/
|
||||
maxDelta: React.PropTypes.number,
|
||||
|
||||
/**
|
||||
* Minimum size of the area that can be displayed.
|
||||
*/
|
||||
minDelta: React.PropTypes.number,
|
||||
|
||||
/**
|
||||
* Insets for the map's legal label, originally at bottom left of the map.
|
||||
*/
|
||||
legalLabelInsets: EdgeInsetsPropType,
|
||||
|
||||
/**
|
||||
* Callback that is called continuously when the user is dragging the map.
|
||||
*/
|
||||
onRegionChange: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* Callback that is called once, when the user is done moving the map.
|
||||
*/
|
||||
onRegionChangeComplete: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* Deprecated. Use annotation `onFocus` and `onBlur` instead.
|
||||
*/
|
||||
onAnnotationPress: React.PropTypes.func,
|
||||
|
||||
/**
|
||||
* @platform android
|
||||
*/
|
||||
active: React.PropTypes.bool,
|
||||
},
|
||||
|
||||
statics: {
|
||||
/**
|
||||
* Standard iOS MapView pin color constants, to be used with the
|
||||
* `annotation.tintColor` property. On iOS 8 and earlier these are the
|
||||
* only supported values when using regular pins. On iOS 9 and later
|
||||
* you are not obliged to use these, but they are useful for matching
|
||||
* the standard iOS look and feel.
|
||||
*/
|
||||
PinColors: {
|
||||
RED: '#ff3b30',
|
||||
GREEN: '#4cd964',
|
||||
PURPLE: '#c969e0',
|
||||
},
|
||||
},
|
||||
|
||||
render: function() {
|
||||
let children = [], {annotations, overlays, followUserLocation} = this.props;
|
||||
annotations = annotations && annotations.map((annotation: Object) => {
|
||||
let {
|
||||
id,
|
||||
image,
|
||||
tintColor,
|
||||
view,
|
||||
leftCalloutView,
|
||||
rightCalloutView,
|
||||
detailCalloutView,
|
||||
} = annotation;
|
||||
|
||||
if (!view && image && tintColor) {
|
||||
view = <Image
|
||||
style={{
|
||||
tintColor: processColor(tintColor),
|
||||
}}
|
||||
source={image}
|
||||
/>;
|
||||
image = undefined;
|
||||
}
|
||||
if (view) {
|
||||
if (image) {
|
||||
console.warn('`image` and `view` both set on annotation. Image will be ignored.');
|
||||
}
|
||||
var viewIndex = children.length;
|
||||
children.push(React.cloneElement(view, {
|
||||
// $FlowFixMe - An array of styles should be fine
|
||||
style: [styles.annotationView, view.props.style || {}]
|
||||
}));
|
||||
}
|
||||
if (leftCalloutView) {
|
||||
var leftCalloutViewIndex = children.length;
|
||||
children.push(React.cloneElement(leftCalloutView, {
|
||||
style: [styles.calloutView, leftCalloutView.props.style || {}]
|
||||
}));
|
||||
}
|
||||
if (rightCalloutView) {
|
||||
var rightCalloutViewIndex = children.length;
|
||||
children.push(React.cloneElement(rightCalloutView, {
|
||||
style: [styles.calloutView, rightCalloutView.props.style || {}]
|
||||
}));
|
||||
}
|
||||
if (detailCalloutView) {
|
||||
var detailCalloutViewIndex = children.length;
|
||||
children.push(React.cloneElement(detailCalloutView, {
|
||||
style: [styles.calloutView, detailCalloutView.props.style || {}]
|
||||
}));
|
||||
}
|
||||
|
||||
const result = {
|
||||
...annotation,
|
||||
tintColor: tintColor && processColor(tintColor),
|
||||
image,
|
||||
viewIndex,
|
||||
leftCalloutViewIndex,
|
||||
rightCalloutViewIndex,
|
||||
detailCalloutViewIndex,
|
||||
view: undefined,
|
||||
leftCalloutView: undefined,
|
||||
rightCalloutView: undefined,
|
||||
detailCalloutView: undefined,
|
||||
};
|
||||
result.id = id || encodeURIComponent(JSON.stringify(result));
|
||||
result.image = image && resolveAssetSource(image);
|
||||
return result;
|
||||
});
|
||||
overlays = overlays && overlays.map((overlay: Object) => {
|
||||
const {id, fillColor, strokeColor} = overlay;
|
||||
const result = {
|
||||
...overlay,
|
||||
strokeColor: strokeColor && processColor(strokeColor),
|
||||
fillColor: fillColor && processColor(fillColor),
|
||||
};
|
||||
result.id = id || encodeURIComponent(JSON.stringify(result));
|
||||
return result;
|
||||
});
|
||||
|
||||
const findByAnnotationId = (annotationId: string) => {
|
||||
if (!annotations) {
|
||||
return null;
|
||||
}
|
||||
for (let i = 0, l = annotations.length; i < l; i++) {
|
||||
if (annotations[i].id === annotationId) {
|
||||
return annotations[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
// TODO: these should be separate events, to reduce bridge traffic
|
||||
let onPress, onAnnotationDragStateChange, onAnnotationFocus, onAnnotationBlur;
|
||||
if (annotations) {
|
||||
onPress = (event: Event) => {
|
||||
if (event.nativeEvent.action === 'annotation-click') {
|
||||
// TODO: Remove deprecated onAnnotationPress API call later.
|
||||
this.props.onAnnotationPress &&
|
||||
this.props.onAnnotationPress(event.nativeEvent.annotation);
|
||||
} else if (event.nativeEvent.action === 'callout-click') {
|
||||
const annotation = findByAnnotationId(event.nativeEvent.annotationId);
|
||||
if (annotation) {
|
||||
// Pass the right function
|
||||
if (event.nativeEvent.side === 'left' && annotation.onLeftCalloutPress) {
|
||||
annotation.onLeftCalloutPress(event.nativeEvent);
|
||||
} else if (event.nativeEvent.side === 'right' && annotation.onRightCalloutPress) {
|
||||
annotation.onRightCalloutPress(event.nativeEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
onAnnotationDragStateChange = (event: Event) => {
|
||||
const annotation = findByAnnotationId(event.nativeEvent.annotationId);
|
||||
if (annotation) {
|
||||
// Call callback
|
||||
annotation.onDragStateChange &&
|
||||
annotation.onDragStateChange(event.nativeEvent);
|
||||
}
|
||||
};
|
||||
onAnnotationFocus = (event: Event) => {
|
||||
const annotation = findByAnnotationId(event.nativeEvent.annotationId);
|
||||
if (annotation && annotation.onFocus) {
|
||||
annotation.onFocus(event.nativeEvent);
|
||||
}
|
||||
};
|
||||
onAnnotationBlur = (event: Event) => {
|
||||
const annotation = findByAnnotationId(event.nativeEvent.annotationId);
|
||||
if (annotation && annotation.onBlur) {
|
||||
annotation.onBlur(event.nativeEvent);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: these should be separate events, to reduce bridge traffic
|
||||
if (this.props.onRegionChange || this.props.onRegionChangeComplete) {
|
||||
var onChange = (event: Event) => {
|
||||
if (event.nativeEvent.continuous) {
|
||||
this.props.onRegionChange &&
|
||||
this.props.onRegionChange(event.nativeEvent.region);
|
||||
} else {
|
||||
this.props.onRegionChangeComplete &&
|
||||
this.props.onRegionChangeComplete(event.nativeEvent.region);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// followUserLocation defaults to true if showUserLocation is set
|
||||
if (followUserLocation === undefined) {
|
||||
// $FlowFixMe(>=0.41.0)
|
||||
followUserLocation = this.props.showUserLocation;
|
||||
}
|
||||
|
||||
return (
|
||||
<RCTMap
|
||||
{...this.props}
|
||||
annotations={annotations}
|
||||
children={children}
|
||||
followUserLocation={followUserLocation}
|
||||
overlays={overlays}
|
||||
onPress={onPress}
|
||||
onChange={onChange}
|
||||
onAnnotationDragStateChange={onAnnotationDragStateChange}
|
||||
onAnnotationFocus={onAnnotationFocus}
|
||||
onAnnotationBlur={onAnnotationBlur}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
annotationView: {
|
||||
position: 'absolute',
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
calloutView: {
|
||||
position: 'absolute',
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
});
|
||||
|
||||
const RCTMap = requireNativeComponent('RCTMap', MapView, {
|
||||
nativeOnly: {
|
||||
onAnnotationDragStateChange: true,
|
||||
onAnnotationFocus: true,
|
||||
onAnnotationBlur: true,
|
||||
onChange: true,
|
||||
onPress: true
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = MapView;
|
|
@ -40,7 +40,6 @@ const ReactNative = {
|
|||
get ImageStore() { return require('ImageStore'); },
|
||||
get KeyboardAvoidingView() { return require('KeyboardAvoidingView'); },
|
||||
get ListView() { return require('ListView'); },
|
||||
get MapView() { return require('MapView'); },
|
||||
get Modal() { return require('Modal'); },
|
||||
get Navigator() { return require('Navigator'); },
|
||||
get NavigatorIOS() { return require('NavigatorIOS'); },
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
1339578B1DF76D3500EC27BE /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };
|
||||
133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */; };
|
||||
13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };
|
||||
13456E961ADAD482009F94A7 /* RCTConvert+MapKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */; };
|
||||
134FCB3D1A6E7F0800051CC8 /* RCTJSCExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */; };
|
||||
13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; };
|
||||
13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
|
||||
|
@ -35,7 +34,6 @@
|
|||
13AB5E021DF777F2001A8C30 /* Yoga.c in Sources */ = {isa = PBXBuildFile; fileRef = 130A77071DF767AF001F9587 /* Yoga.c */; };
|
||||
13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };
|
||||
13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AF20441AE707F9005F5298 /* RCTSlider.m */; };
|
||||
13AFBCA01C07247D00BBAEAA /* RCTMapOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AFBC9F1C07247D00BBAEAA /* RCTMapOverlay.m */; };
|
||||
13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };
|
||||
13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; };
|
||||
13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; };
|
||||
|
@ -47,7 +45,6 @@
|
|||
13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080131A69489C00A75B9A /* RCTNavItemManager.m */; };
|
||||
13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */; };
|
||||
13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */; };
|
||||
13B202041BFB948C00C07393 /* RCTMapAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B202031BFB948C00C07393 /* RCTMapAnnotation.m */; };
|
||||
13BB3D021BECD54500932C10 /* RCTImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BB3D011BECD54500932C10 /* RCTImageSource.m */; };
|
||||
13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE8081C99CB9D00DD7AAD /* RCTRootShadowView.m */; };
|
||||
13C156051AB1A2840079392D /* RCTWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13C156021AB1A2840079392D /* RCTWebView.m */; };
|
||||
|
@ -64,8 +61,6 @@
|
|||
13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 14BF717F1C04793D00C97D0C /* RCTProfileTrampoline-i386.S */; };
|
||||
13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 13F17A841B8493E5007D4C75 /* RCTRedBox.m */; };
|
||||
142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 142014171B32094000CC17BA /* RCTPerformanceLogger.m */; };
|
||||
14435CE51AAC4AE100FC20F4 /* RCTMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE21AAC4AE100FC20F4 /* RCTMap.m */; };
|
||||
14435CE61AAC4AE100FC20F4 /* RCTMapManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */; };
|
||||
1450FF861BCFF28A00208362 /* RCTProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF811BCFF28A00208362 /* RCTProfile.m */; };
|
||||
1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */; };
|
||||
1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = 1450FF831BCFF28A00208362 /* RCTProfileTrampoline-arm64.S */; };
|
||||
|
@ -133,12 +128,7 @@
|
|||
2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */; };
|
||||
2D3B5ECA1D9B095F00451313 /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };
|
||||
2D3B5ECB1D9B096200451313 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; };
|
||||
2D3B5ECC1D9B096500451313 /* RCTConvert+MapKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */; };
|
||||
2D3B5ECF1D9B096F00451313 /* RCTFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D37B5811D522B190042D5B5 /* RCTFont.mm */; };
|
||||
2D3B5ED01D9B097200451313 /* RCTMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE21AAC4AE100FC20F4 /* RCTMap.m */; };
|
||||
2D3B5ED11D9B097500451313 /* RCTMapAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B202031BFB948C00C07393 /* RCTMapAnnotation.m */; };
|
||||
2D3B5ED21D9B097800451313 /* RCTMapManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */; };
|
||||
2D3B5ED31D9B097B00451313 /* RCTMapOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AFBC9F1C07247D00BBAEAA /* RCTMapOverlay.m */; };
|
||||
2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */; };
|
||||
2D3B5ED51D9B098000451313 /* RCTModalHostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83392EB21B6634E10013B15F /* RCTModalHostViewController.m */; };
|
||||
2D3B5ED61D9B098400451313 /* RCTModalHostViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A1FE8E1B62643A00BE0E65 /* RCTModalHostViewManager.m */; };
|
||||
|
@ -251,12 +241,7 @@
|
|||
3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };
|
||||
3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };
|
||||
3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };
|
||||
3D302F731DF828F800D6DDAE /* RCTConvert+MapKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */; };
|
||||
3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };
|
||||
3D302F771DF828F800D6DDAE /* RCTMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14435CE11AAC4AE100FC20F4 /* RCTMap.h */; };
|
||||
3D302F781DF828F800D6DDAE /* RCTMapAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B202021BFB948C00C07393 /* RCTMapAnnotation.h */; };
|
||||
3D302F791DF828F800D6DDAE /* RCTMapManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */; };
|
||||
3D302F7A1DF828F800D6DDAE /* RCTMapOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */; };
|
||||
3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };
|
||||
3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };
|
||||
3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };
|
||||
|
@ -367,12 +352,7 @@
|
|||
3D302FEC1DF8290600D6DDAE /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };
|
||||
3D302FED1DF8290600D6DDAE /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };
|
||||
3D302FEE1DF8290600D6DDAE /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };
|
||||
3D302FEF1DF8290600D6DDAE /* RCTConvert+MapKit.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */; };
|
||||
3D302FF21DF8290600D6DDAE /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };
|
||||
3D302FF31DF8290600D6DDAE /* RCTMap.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14435CE11AAC4AE100FC20F4 /* RCTMap.h */; };
|
||||
3D302FF41DF8290600D6DDAE /* RCTMapAnnotation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B202021BFB948C00C07393 /* RCTMapAnnotation.h */; };
|
||||
3D302FF51DF8290600D6DDAE /* RCTMapManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */; };
|
||||
3D302FF61DF8290600D6DDAE /* RCTMapOverlay.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */; };
|
||||
3D302FF71DF8290600D6DDAE /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };
|
||||
3D302FF81DF8290600D6DDAE /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };
|
||||
3D302FF91DF8290600D6DDAE /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };
|
||||
|
@ -515,14 +495,9 @@
|
|||
3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };
|
||||
3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };
|
||||
3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };
|
||||
3D80D96E1DF6FA890028D040 /* RCTConvert+MapKit.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */; };
|
||||
3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };
|
||||
3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };
|
||||
3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };
|
||||
3D80D9721DF6FA890028D040 /* RCTMap.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14435CE11AAC4AE100FC20F4 /* RCTMap.h */; };
|
||||
3D80D9731DF6FA890028D040 /* RCTMapAnnotation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13B202021BFB948C00C07393 /* RCTMapAnnotation.h */; };
|
||||
3D80D9741DF6FA890028D040 /* RCTMapManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */; };
|
||||
3D80D9751DF6FA890028D040 /* RCTMapOverlay.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */; };
|
||||
3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };
|
||||
3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };
|
||||
3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };
|
||||
|
@ -638,14 +613,9 @@
|
|||
3D80DA651DF820620028D040 /* RCTComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 13C325281AA63B6A0048765F /* RCTComponent.h */; };
|
||||
3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AB90BF1B6FA36700713B4F /* RCTComponentData.h */; };
|
||||
3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */; };
|
||||
3D80DA681DF820620028D040 /* RCTConvert+MapKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */; };
|
||||
3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */; };
|
||||
3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */; };
|
||||
3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D37B5801D522B190042D5B5 /* RCTFont.h */; };
|
||||
3D80DA6C1DF820620028D040 /* RCTMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14435CE11AAC4AE100FC20F4 /* RCTMap.h */; };
|
||||
3D80DA6D1DF820620028D040 /* RCTMapAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 13B202021BFB948C00C07393 /* RCTMapAnnotation.h */; };
|
||||
3D80DA6E1DF820620028D040 /* RCTMapManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */; };
|
||||
3D80DA6F1DF820620028D040 /* RCTMapOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */; };
|
||||
3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */; };
|
||||
3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */; };
|
||||
3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A1FE8D1B62643A00BE0E65 /* RCTModalHostViewManager.h */; };
|
||||
|
@ -909,12 +879,7 @@
|
|||
3D302FEC1DF8290600D6DDAE /* RCTComponent.h in Copy Headers */,
|
||||
3D302FED1DF8290600D6DDAE /* RCTComponentData.h in Copy Headers */,
|
||||
3D302FEE1DF8290600D6DDAE /* RCTConvert+CoreLocation.h in Copy Headers */,
|
||||
3D302FEF1DF8290600D6DDAE /* RCTConvert+MapKit.h in Copy Headers */,
|
||||
3D302FF21DF8290600D6DDAE /* RCTFont.h in Copy Headers */,
|
||||
3D302FF31DF8290600D6DDAE /* RCTMap.h in Copy Headers */,
|
||||
3D302FF41DF8290600D6DDAE /* RCTMapAnnotation.h in Copy Headers */,
|
||||
3D302FF51DF8290600D6DDAE /* RCTMapManager.h in Copy Headers */,
|
||||
3D302FF61DF8290600D6DDAE /* RCTMapOverlay.h in Copy Headers */,
|
||||
3D302FF71DF8290600D6DDAE /* RCTModalHostView.h in Copy Headers */,
|
||||
3D302FF81DF8290600D6DDAE /* RCTModalHostViewController.h in Copy Headers */,
|
||||
3D302FF91DF8290600D6DDAE /* RCTModalHostViewManager.h in Copy Headers */,
|
||||
|
@ -1073,14 +1038,9 @@
|
|||
3D80D96B1DF6FA890028D040 /* RCTComponent.h in Copy Headers */,
|
||||
3D80D96C1DF6FA890028D040 /* RCTComponentData.h in Copy Headers */,
|
||||
3D80D96D1DF6FA890028D040 /* RCTConvert+CoreLocation.h in Copy Headers */,
|
||||
3D80D96E1DF6FA890028D040 /* RCTConvert+MapKit.h in Copy Headers */,
|
||||
3D80D96F1DF6FA890028D040 /* RCTDatePicker.h in Copy Headers */,
|
||||
3D80D9701DF6FA890028D040 /* RCTDatePickerManager.h in Copy Headers */,
|
||||
3D80D9711DF6FA890028D040 /* RCTFont.h in Copy Headers */,
|
||||
3D80D9721DF6FA890028D040 /* RCTMap.h in Copy Headers */,
|
||||
3D80D9731DF6FA890028D040 /* RCTMapAnnotation.h in Copy Headers */,
|
||||
3D80D9741DF6FA890028D040 /* RCTMapManager.h in Copy Headers */,
|
||||
3D80D9751DF6FA890028D040 /* RCTMapOverlay.h in Copy Headers */,
|
||||
3D80D9761DF6FA890028D040 /* RCTModalHostView.h in Copy Headers */,
|
||||
3D80D9771DF6FA890028D040 /* RCTModalHostViewController.h in Copy Headers */,
|
||||
3D80D9781DF6FA890028D040 /* RCTModalHostViewManager.h in Copy Headers */,
|
||||
|
@ -1186,8 +1146,6 @@
|
|||
13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewControllerProtocol.h; sourceTree = "<group>"; };
|
||||
13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+CoreLocation.h"; sourceTree = "<group>"; };
|
||||
13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+CoreLocation.m"; sourceTree = "<group>"; };
|
||||
13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+MapKit.h"; sourceTree = "<group>"; };
|
||||
13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+MapKit.m"; sourceTree = "<group>"; };
|
||||
1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestDelegate.h; sourceTree = "<group>"; };
|
||||
1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestHandler.h; sourceTree = "<group>"; };
|
||||
134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTJSCExecutor.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
|
@ -1219,8 +1177,6 @@
|
|||
13AF1F851AE6E777005F5298 /* RCTDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDefines.h; sourceTree = "<group>"; };
|
||||
13AF20431AE707F8005F5298 /* RCTSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSlider.h; sourceTree = "<group>"; };
|
||||
13AF20441AE707F9005F5298 /* RCTSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSlider.m; sourceTree = "<group>"; };
|
||||
13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMapOverlay.h; sourceTree = "<group>"; };
|
||||
13AFBC9F1C07247D00BBAEAA /* RCTMapOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMapOverlay.m; sourceTree = "<group>"; };
|
||||
13AFBCA11C07287B00BBAEAA /* RCTBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeMethod.h; sourceTree = "<group>"; };
|
||||
13AFBCA21C07287B00BBAEAA /* RCTRootViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewDelegate.h; sourceTree = "<group>"; };
|
||||
13B07FE71A69327A00A75B9A /* RCTAlertManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAlertManager.h; sourceTree = "<group>"; };
|
||||
|
@ -1245,8 +1201,6 @@
|
|||
13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorViewManager.m; sourceTree = "<group>"; };
|
||||
13B080231A694A8400A75B9A /* RCTWrapperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWrapperViewController.h; sourceTree = "<group>"; };
|
||||
13B080241A694A8400A75B9A /* RCTWrapperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWrapperViewController.m; sourceTree = "<group>"; };
|
||||
13B202021BFB948C00C07393 /* RCTMapAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMapAnnotation.h; sourceTree = "<group>"; };
|
||||
13B202031BFB948C00C07393 /* RCTMapAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMapAnnotation.m; sourceTree = "<group>"; };
|
||||
13BB3D001BECD54500932C10 /* RCTImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageSource.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
13BB3D011BECD54500932C10 /* RCTImageSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageSource.m; sourceTree = "<group>"; };
|
||||
13BCE8071C99CB9D00DD7AAD /* RCTRootShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootShadowView.h; sourceTree = "<group>"; };
|
||||
|
@ -1282,10 +1236,6 @@
|
|||
142014171B32094000CC17BA /* RCTPerformanceLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPerformanceLogger.m; sourceTree = "<group>"; };
|
||||
142014181B32094000CC17BA /* RCTPerformanceLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPerformanceLogger.h; sourceTree = "<group>"; };
|
||||
1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTFrameUpdate.h; sourceTree = "<group>"; };
|
||||
14435CE11AAC4AE100FC20F4 /* RCTMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMap.h; sourceTree = "<group>"; };
|
||||
14435CE21AAC4AE100FC20F4 /* RCTMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMap.m; sourceTree = "<group>"; };
|
||||
14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMapManager.h; sourceTree = "<group>"; };
|
||||
14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMapManager.m; sourceTree = "<group>"; };
|
||||
1450FF801BCFF28A00208362 /* RCTProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProfile.h; sourceTree = "<group>"; };
|
||||
1450FF811BCFF28A00208362 /* RCTProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProfile.m; sourceTree = "<group>"; };
|
||||
1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = "RCTProfileTrampoline-arm.S"; sourceTree = "<group>"; };
|
||||
|
@ -1545,8 +1495,6 @@
|
|||
13AB90C01B6FA36700713B4F /* RCTComponentData.m */,
|
||||
13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */,
|
||||
13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */,
|
||||
13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */,
|
||||
13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */,
|
||||
945929C21DD62ADD00653A7D /* RCTConvert+Transform.h */,
|
||||
945929C31DD62ADD00653A7D /* RCTConvert+Transform.m */,
|
||||
133CAE8C1B8E5CFD00F6AD92 /* RCTDatePicker.h */,
|
||||
|
@ -1555,14 +1503,6 @@
|
|||
58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */,
|
||||
3D37B5801D522B190042D5B5 /* RCTFont.h */,
|
||||
3D37B5811D522B190042D5B5 /* RCTFont.mm */,
|
||||
14435CE11AAC4AE100FC20F4 /* RCTMap.h */,
|
||||
14435CE21AAC4AE100FC20F4 /* RCTMap.m */,
|
||||
13B202021BFB948C00C07393 /* RCTMapAnnotation.h */,
|
||||
13B202031BFB948C00C07393 /* RCTMapAnnotation.m */,
|
||||
14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */,
|
||||
14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */,
|
||||
13AFBC9E1C07247D00BBAEAA /* RCTMapOverlay.h */,
|
||||
13AFBC9F1C07247D00BBAEAA /* RCTMapOverlay.m */,
|
||||
83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */,
|
||||
83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */,
|
||||
83392EB11B6634E10013B15F /* RCTModalHostViewController.h */,
|
||||
|
@ -1976,12 +1916,7 @@
|
|||
3D302F701DF828F800D6DDAE /* RCTComponent.h in Headers */,
|
||||
3D302F711DF828F800D6DDAE /* RCTComponentData.h in Headers */,
|
||||
3D302F721DF828F800D6DDAE /* RCTConvert+CoreLocation.h in Headers */,
|
||||
3D302F731DF828F800D6DDAE /* RCTConvert+MapKit.h in Headers */,
|
||||
3D302F761DF828F800D6DDAE /* RCTFont.h in Headers */,
|
||||
3D302F771DF828F800D6DDAE /* RCTMap.h in Headers */,
|
||||
3D302F781DF828F800D6DDAE /* RCTMapAnnotation.h in Headers */,
|
||||
3D302F791DF828F800D6DDAE /* RCTMapManager.h in Headers */,
|
||||
3D302F7A1DF828F800D6DDAE /* RCTMapOverlay.h in Headers */,
|
||||
3D302F7B1DF828F800D6DDAE /* RCTModalHostView.h in Headers */,
|
||||
3D302F7C1DF828F800D6DDAE /* RCTModalHostViewController.h in Headers */,
|
||||
3D302F7D1DF828F800D6DDAE /* RCTModalHostViewManager.h in Headers */,
|
||||
|
@ -2168,15 +2103,10 @@
|
|||
3D80DA651DF820620028D040 /* RCTComponent.h in Headers */,
|
||||
3D80DA661DF820620028D040 /* RCTComponentData.h in Headers */,
|
||||
3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */,
|
||||
3D80DA681DF820620028D040 /* RCTConvert+MapKit.h in Headers */,
|
||||
3D80DA691DF820620028D040 /* RCTDatePicker.h in Headers */,
|
||||
3D80DA6A1DF820620028D040 /* RCTDatePickerManager.h in Headers */,
|
||||
3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */,
|
||||
3D80DA6C1DF820620028D040 /* RCTMap.h in Headers */,
|
||||
3D80DA6D1DF820620028D040 /* RCTMapAnnotation.h in Headers */,
|
||||
3D80DA6E1DF820620028D040 /* RCTMapManager.h in Headers */,
|
||||
B505583F1E43DFB900F71A00 /* RCTDevSettings.h in Headers */,
|
||||
3D80DA6F1DF820620028D040 /* RCTMapOverlay.h in Headers */,
|
||||
3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */,
|
||||
3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */,
|
||||
3D80DA721DF820620028D040 /* RCTModalHostViewManager.h in Headers */,
|
||||
|
@ -2487,7 +2417,6 @@
|
|||
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */,
|
||||
2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */,
|
||||
B50558411E43E13D00F71A00 /* RCTDevMenu.m in Sources */,
|
||||
2D3B5ED31D9B097B00451313 /* RCTMapOverlay.m in Sources */,
|
||||
2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */,
|
||||
2D9F8B9B1DE398DB00A16144 /* RCTPlatform.m in Sources */,
|
||||
2D3B5EBF1D9B093300451313 /* RCTJSCProfiler.m in Sources */,
|
||||
|
@ -2509,7 +2438,6 @@
|
|||
2D3B5EE31D9B09B700451313 /* RCTSegmentedControl.m in Sources */,
|
||||
A12E9E251E5DEB4D0029001B /* RCTPackagerClient.m in Sources */,
|
||||
2D3B5EB71D9B091800451313 /* RCTRedBox.m in Sources */,
|
||||
2D3B5ED11D9B097500451313 /* RCTMapAnnotation.m in Sources */,
|
||||
2D3B5EAF1D9B08FB00451313 /* RCTAccessibilityManager.m in Sources */,
|
||||
2D3B5EF11D9B09E700451313 /* UIView+React.m in Sources */,
|
||||
2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */,
|
||||
|
@ -2521,7 +2449,6 @@
|
|||
2D3B5EE11D9B09B000451313 /* RCTScrollView.m in Sources */,
|
||||
2D3B5ED81D9B098A00451313 /* RCTNavigatorManager.m in Sources */,
|
||||
2D3B5E951D9B087C00451313 /* RCTAssert.m in Sources */,
|
||||
2D3B5ED21D9B097800451313 /* RCTMapManager.m in Sources */,
|
||||
2D3B5EB61D9B091400451313 /* RCTExceptionsManager.m in Sources */,
|
||||
2D3B5EEB1D9B09D000451313 /* RCTTabBarItem.m in Sources */,
|
||||
2D3B5E961D9B088500451313 /* RCTBatchedBridge.m in Sources */,
|
||||
|
@ -2535,7 +2462,6 @@
|
|||
A12E9E261E5DEB510029001B /* RCTPackagerClientResponder.m in Sources */,
|
||||
2D3B5EEE1D9B09DA00451313 /* RCTView.m in Sources */,
|
||||
594AD5D01E46D87500B07237 /* RCTScrollContentShadowView.m in Sources */,
|
||||
2D3B5ECC1D9B096500451313 /* RCTConvert+MapKit.m in Sources */,
|
||||
2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */,
|
||||
2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */,
|
||||
3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */,
|
||||
|
@ -2553,7 +2479,6 @@
|
|||
A12E9E5D1E5DF8720029001B /* RCTReloadPackagerMethod.m in Sources */,
|
||||
3D5AC71A1E0056E0000F9153 /* RCTTVNavigationEventEmitter.m in Sources */,
|
||||
3D7A27E31DE325DA002E3F95 /* RCTJSCErrorHandling.mm in Sources */,
|
||||
2D3B5ED01D9B097200451313 /* RCTMap.m in Sources */,
|
||||
2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */,
|
||||
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */,
|
||||
2D3B5EF01D9B09E300451313 /* RCTWrapperViewController.m in Sources */,
|
||||
|
@ -2640,7 +2565,6 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
597AD1BF1E577D7800152581 /* RCTRootContentView.m in Sources */,
|
||||
13456E961ADAD482009F94A7 /* RCTConvert+MapKit.m in Sources */,
|
||||
13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */,
|
||||
000E6CEB1AB0E980000CDF4D /* RCTSourceCode.m in Sources */,
|
||||
14A43DF31C20B1C900794BC8 /* RCTJSCProfiler.m in Sources */,
|
||||
|
@ -2654,7 +2578,6 @@
|
|||
131B6AF41AF1093D00FFC3E0 /* RCTSegmentedControl.m in Sources */,
|
||||
830A229E1A66C68A008503DA /* RCTRootView.m in Sources */,
|
||||
13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */,
|
||||
13B202041BFB948C00C07393 /* RCTMapAnnotation.m in Sources */,
|
||||
A12E9E8F1E5DFA620029001B /* RCTSamplingProfilerPackagerMethod.mm in Sources */,
|
||||
13BCE8091C99CB9D00DD7AAD /* RCTRootShadowView.m in Sources */,
|
||||
14C2CA711B3AC63800E6CBB2 /* RCTModuleMethod.m in Sources */,
|
||||
|
@ -2710,14 +2633,12 @@
|
|||
13E067571A70F44B002CDEE1 /* RCTView.m in Sources */,
|
||||
3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */,
|
||||
A12E9E1E1E5DEA350029001B /* RCTPackagerClientResponder.m in Sources */,
|
||||
13AFBCA01C07247D00BBAEAA /* RCTMapOverlay.m in Sources */,
|
||||
13D9FEEE1CDCD93000158BD7 /* RCTKeyboardObserver.m in Sources */,
|
||||
B233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */,
|
||||
13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */,
|
||||
137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */,
|
||||
13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */,
|
||||
83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */,
|
||||
14435CE61AAC4AE100FC20F4 /* RCTMapManager.m in Sources */,
|
||||
191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */,
|
||||
13C156051AB1A2840079392D /* RCTWebView.m in Sources */,
|
||||
83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */,
|
||||
|
@ -2736,7 +2657,6 @@
|
|||
137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */,
|
||||
13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */,
|
||||
83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */,
|
||||
14435CE51AAC4AE100FC20F4 /* RCTMap.m in Sources */,
|
||||
13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */,
|
||||
83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */,
|
||||
A12E9E5B1E5DF8600029001B /* RCTReloadPackagerMethod.m in Sources */,
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
#import <React/RCTConvert.h>
|
||||
|
||||
@class RCTMapAnnotation;
|
||||
@class RCTMapOverlay;
|
||||
|
||||
@interface RCTConvert (MapKit)
|
||||
|
||||
+ (MKCoordinateSpan)MKCoordinateSpan:(id)json;
|
||||
+ (MKCoordinateRegion)MKCoordinateRegion:(id)json;
|
||||
+ (MKMapType)MKMapType:(id)json;
|
||||
|
||||
+ (RCTMapAnnotation *)RCTMapAnnotation:(id)json;
|
||||
+ (RCTMapOverlay *)RCTMapOverlay:(id)json;
|
||||
|
||||
+ (NSArray<RCTMapAnnotation *> *)RCTMapAnnotationArray:(id)json;
|
||||
+ (NSArray<RCTMapOverlay *> *)RCTMapOverlayArray:(id)json;
|
||||
|
||||
@end
|
|
@ -1,88 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTConvert+MapKit.h"
|
||||
#import "RCTConvert+CoreLocation.h"
|
||||
#import "RCTMapAnnotation.h"
|
||||
#import "RCTMapOverlay.h"
|
||||
|
||||
@implementation RCTConvert(MapKit)
|
||||
|
||||
+ (MKCoordinateSpan)MKCoordinateSpan:(id)json
|
||||
{
|
||||
json = [self NSDictionary:json];
|
||||
return (MKCoordinateSpan){
|
||||
[self CLLocationDegrees:json[@"latitudeDelta"]],
|
||||
[self CLLocationDegrees:json[@"longitudeDelta"]]
|
||||
};
|
||||
}
|
||||
|
||||
+ (MKCoordinateRegion)MKCoordinateRegion:(id)json
|
||||
{
|
||||
return (MKCoordinateRegion){
|
||||
[self CLLocationCoordinate2D:json],
|
||||
[self MKCoordinateSpan:json]
|
||||
};
|
||||
}
|
||||
|
||||
RCT_ENUM_CONVERTER(MKMapType, (@{
|
||||
@"standard": @(MKMapTypeStandard),
|
||||
@"satellite": @(MKMapTypeSatellite),
|
||||
@"hybrid": @(MKMapTypeHybrid),
|
||||
}), MKMapTypeStandard, integerValue)
|
||||
|
||||
+ (RCTMapAnnotation *)RCTMapAnnotation:(id)json
|
||||
{
|
||||
json = [self NSDictionary:json];
|
||||
RCTMapAnnotation *annotation = [RCTMapAnnotation new];
|
||||
annotation.coordinate = [self CLLocationCoordinate2D:json];
|
||||
annotation.draggable = [self BOOL:json[@"draggable"]];
|
||||
annotation.title = [self NSString:json[@"title"]];
|
||||
annotation.subtitle = [self NSString:json[@"subtitle"]];
|
||||
annotation.identifier = [self NSString:json[@"id"]];
|
||||
annotation.hasLeftCallout = [self BOOL:json[@"hasLeftCallout"]];
|
||||
annotation.hasRightCallout = [self BOOL:json[@"hasRightCallout"]];
|
||||
annotation.animateDrop = [self BOOL:json[@"animateDrop"]];
|
||||
annotation.tintColor = [self UIColor:json[@"tintColor"]];
|
||||
annotation.image = [self UIImage:json[@"image"]];
|
||||
annotation.viewIndex =
|
||||
[self NSInteger:json[@"viewIndex"] ?: @(NSNotFound)];
|
||||
annotation.leftCalloutViewIndex =
|
||||
[self NSInteger:json[@"leftCalloutViewIndex"] ?: @(NSNotFound)];
|
||||
annotation.rightCalloutViewIndex =
|
||||
[self NSInteger:json[@"rightCalloutViewIndex"] ?: @(NSNotFound)];
|
||||
annotation.detailCalloutViewIndex =
|
||||
[self NSInteger:json[@"detailCalloutViewIndex"] ?: @(NSNotFound)];
|
||||
return annotation;
|
||||
}
|
||||
|
||||
RCT_ARRAY_CONVERTER(RCTMapAnnotation)
|
||||
|
||||
+ (RCTMapOverlay *)RCTMapOverlay:(id)json
|
||||
{
|
||||
json = [self NSDictionary:json];
|
||||
NSArray<NSDictionary *> *locations = [self NSDictionaryArray:json[@"coordinates"]];
|
||||
CLLocationCoordinate2D coordinates[locations.count];
|
||||
NSUInteger index = 0;
|
||||
for (NSDictionary *location in locations) {
|
||||
coordinates[index++] = [self CLLocationCoordinate2D:location];
|
||||
}
|
||||
|
||||
RCTMapOverlay *overlay = [RCTMapOverlay polylineWithCoordinates:coordinates
|
||||
count:locations.count];
|
||||
|
||||
overlay.strokeColor = [self UIColor:json[@"strokeColor"]];
|
||||
overlay.identifier = [self NSString:json[@"id"]];
|
||||
overlay.lineWidth = [self CGFloat:json[@"lineWidth"] ?: @1];
|
||||
return overlay;
|
||||
}
|
||||
|
||||
RCT_ARRAY_CONVERTER(RCTMapOverlay)
|
||||
|
||||
@end
|
|
@ -1,41 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <MapKit/MapKit.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <React/RCTComponent.h>
|
||||
#import <React/RCTConvert+MapKit.h>
|
||||
|
||||
RCT_EXTERN const CLLocationDegrees RCTMapDefaultSpan;
|
||||
RCT_EXTERN const NSTimeInterval RCTMapRegionChangeObserveInterval;
|
||||
RCT_EXTERN const CGFloat RCTMapZoomBoundBuffer;
|
||||
|
||||
@interface RCTMap: MKMapView
|
||||
|
||||
@property (nonatomic, assign) BOOL followUserLocation;
|
||||
@property (nonatomic, assign) BOOL hasStartedRendering;
|
||||
@property (nonatomic, assign) BOOL showsAnnotationCallouts;
|
||||
@property (nonatomic, assign) CGFloat minDelta;
|
||||
@property (nonatomic, assign) CGFloat maxDelta;
|
||||
@property (nonatomic, assign) UIEdgeInsets legalLabelInsets;
|
||||
@property (nonatomic, strong) NSTimer *regionChangeObserveTimer;
|
||||
@property (nonatomic, copy) NSArray<NSString *> *annotationIDs;
|
||||
@property (nonatomic, copy) NSArray<NSString *> *overlayIDs;
|
||||
|
||||
@property (nonatomic, copy) RCTBubblingEventBlock onChange;
|
||||
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
||||
@property (nonatomic, copy) RCTBubblingEventBlock onAnnotationDragStateChange;
|
||||
@property (nonatomic, copy) RCTBubblingEventBlock onAnnotationFocus;
|
||||
@property (nonatomic, copy) RCTBubblingEventBlock onAnnotationBlur;
|
||||
|
||||
- (void)setAnnotations:(NSArray<RCTMapAnnotation *> *)annotations;
|
||||
- (void)setOverlays:(NSArray<RCTMapOverlay *> *)overlays;
|
||||
|
||||
@end
|
|
@ -1,214 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTMap.h"
|
||||
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTMapAnnotation.h"
|
||||
#import "RCTMapOverlay.h"
|
||||
#import "RCTUtils.h"
|
||||
#import "UIView+React.h"
|
||||
|
||||
const CLLocationDegrees RCTMapDefaultSpan = 0.005;
|
||||
const NSTimeInterval RCTMapRegionChangeObserveInterval = 0.1;
|
||||
const CGFloat RCTMapZoomBoundBuffer = 0.01;
|
||||
|
||||
@implementation RCTMap
|
||||
{
|
||||
UIView *_legalLabel;
|
||||
CLLocationManager *_locationManager;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
|
||||
_hasStartedRendering = NO;
|
||||
|
||||
// Find Apple link label
|
||||
for (UIView *subview in self.subviews) {
|
||||
if ([NSStringFromClass(subview.class) isEqualToString:@"MKAttributionLabel"]) {
|
||||
// This check is super hacky, but the whole premise of moving around
|
||||
// Apple's internal subviews is super hacky
|
||||
_legalLabel = subview;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_regionChangeObserveTimer invalidate];
|
||||
}
|
||||
|
||||
- (void)didUpdateReactSubviews
|
||||
{
|
||||
// Do nothing, as annotation views are managed by `setAnnotations:` method
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
if (_legalLabel) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
CGRect frame = self->_legalLabel.frame;
|
||||
if (self->_legalLabelInsets.left) {
|
||||
frame.origin.x = self->_legalLabelInsets.left;
|
||||
} else if (self->_legalLabelInsets.right) {
|
||||
frame.origin.x = self.frame.size.width - self->_legalLabelInsets.right - frame.size.width;
|
||||
}
|
||||
if (self->_legalLabelInsets.top) {
|
||||
frame.origin.y = self->_legalLabelInsets.top;
|
||||
} else if (self->_legalLabelInsets.bottom) {
|
||||
frame.origin.y = self.frame.size.height - self->_legalLabelInsets.bottom - frame.size.height;
|
||||
}
|
||||
self->_legalLabel.frame = frame;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Accessors
|
||||
|
||||
- (void)setShowsUserLocation:(BOOL)showsUserLocation
|
||||
{
|
||||
if (self.showsUserLocation != showsUserLocation) {
|
||||
if (showsUserLocation && !_locationManager) {
|
||||
_locationManager = [CLLocationManager new];
|
||||
if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
|
||||
[_locationManager requestWhenInUseAuthorization];
|
||||
}
|
||||
}
|
||||
super.showsUserLocation = showsUserLocation;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setRegion:(MKCoordinateRegion)region animated:(BOOL)animated
|
||||
{
|
||||
// If location is invalid, abort
|
||||
if (!CLLocationCoordinate2DIsValid(region.center)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If new span values are nil, use old values instead
|
||||
if (!region.span.latitudeDelta) {
|
||||
region.span.latitudeDelta = self.region.span.latitudeDelta;
|
||||
}
|
||||
if (!region.span.longitudeDelta) {
|
||||
region.span.longitudeDelta = self.region.span.longitudeDelta;
|
||||
}
|
||||
|
||||
// Animate to new position
|
||||
[super setRegion:region animated:animated];
|
||||
}
|
||||
|
||||
// TODO: this doesn't preserve order. Should it? If so we should change the
|
||||
// algorithm. If not, it would be more efficient to use an NSSet
|
||||
- (void)setAnnotations:(NSArray<RCTMapAnnotation *> *)annotations
|
||||
{
|
||||
NSMutableArray<NSString *> *newAnnotationIDs = [NSMutableArray new];
|
||||
NSMutableArray<RCTMapAnnotation *> *annotationsToDelete = [NSMutableArray new];
|
||||
NSMutableArray<RCTMapAnnotation *> *annotationsToAdd = [NSMutableArray new];
|
||||
|
||||
for (RCTMapAnnotation *annotation in annotations) {
|
||||
if (![annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
[newAnnotationIDs addObject:annotation.identifier];
|
||||
|
||||
// If the current set does not contain the new annotation, mark it to add
|
||||
if (![_annotationIDs containsObject:annotation.identifier]) {
|
||||
[annotationsToAdd addObject:annotation];
|
||||
}
|
||||
}
|
||||
|
||||
for (RCTMapAnnotation *annotation in self.annotations) {
|
||||
if (![annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the new set does not contain an existing annotation, mark it to delete
|
||||
if (![newAnnotationIDs containsObject:annotation.identifier]) {
|
||||
[annotationsToDelete addObject:annotation];
|
||||
}
|
||||
}
|
||||
|
||||
if (annotationsToDelete.count) {
|
||||
[self removeAnnotations:(NSArray<id<MKAnnotation>> *)annotationsToDelete];
|
||||
}
|
||||
|
||||
if (annotationsToAdd.count) {
|
||||
[self addAnnotations:(NSArray<id<MKAnnotation>> *)annotationsToAdd];
|
||||
}
|
||||
|
||||
self.annotationIDs = newAnnotationIDs;
|
||||
}
|
||||
|
||||
// TODO: this doesn't preserve order. Should it? If so we should change the
|
||||
// algorithm. If not, it would be more efficient to use an NSSet
|
||||
- (void)setOverlays:(NSArray<RCTMapOverlay *> *)overlays
|
||||
{
|
||||
NSMutableArray *newOverlayIDs = [NSMutableArray new];
|
||||
NSMutableArray *overlaysToDelete = [NSMutableArray new];
|
||||
NSMutableArray *overlaysToAdd = [NSMutableArray new];
|
||||
|
||||
for (RCTMapOverlay *overlay in overlays) {
|
||||
if (![overlay isKindOfClass:[RCTMapOverlay class]]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
[newOverlayIDs addObject:overlay.identifier];
|
||||
|
||||
// If the current set does not contain the new annotation, mark it to add
|
||||
if (![_annotationIDs containsObject:overlay.identifier]) {
|
||||
[overlaysToAdd addObject:overlay];
|
||||
}
|
||||
}
|
||||
|
||||
for (RCTMapOverlay *overlay in self.overlays) {
|
||||
if (![overlay isKindOfClass:[RCTMapOverlay class]]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the new set does not contain an existing annotation, mark it to delete
|
||||
if (![newOverlayIDs containsObject:overlay.identifier]) {
|
||||
[overlaysToDelete addObject:overlay];
|
||||
}
|
||||
}
|
||||
|
||||
if (overlaysToDelete.count) {
|
||||
[self removeOverlays:(NSArray<id<MKOverlay>> *)overlaysToDelete];
|
||||
}
|
||||
|
||||
if (overlaysToAdd.count) {
|
||||
[self addOverlays:(NSArray<id<MKOverlay>> *)overlaysToAdd
|
||||
level:MKOverlayLevelAboveRoads];
|
||||
}
|
||||
|
||||
self.overlayIDs = newOverlayIDs;
|
||||
}
|
||||
|
||||
- (BOOL)showsCompass {
|
||||
if ([MKMapView instancesRespondToSelector:@selector(showsCompass)]) {
|
||||
return super. showsCompass;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)setShowsCompass:(BOOL)showsCompass {
|
||||
if ([MKMapView instancesRespondToSelector:@selector(setShowsCompass:)]) {
|
||||
super.showsCompass = showsCompass;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
@interface RCTMapAnnotation : MKPointAnnotation <MKAnnotation>
|
||||
|
||||
@property (nonatomic, copy) NSString *identifier;
|
||||
@property (nonatomic, assign) BOOL hasLeftCallout;
|
||||
@property (nonatomic, assign) BOOL hasRightCallout;
|
||||
@property (nonatomic, assign) BOOL animateDrop;
|
||||
@property (nonatomic, strong) UIColor *tintColor;
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
@property (nonatomic, assign) NSUInteger viewIndex;
|
||||
@property (nonatomic, assign) NSUInteger leftCalloutViewIndex;
|
||||
@property (nonatomic, assign) NSUInteger rightCalloutViewIndex;
|
||||
@property (nonatomic, assign) NSUInteger detailCalloutViewIndex;
|
||||
@property (nonatomic, assign) BOOL draggable;
|
||||
|
||||
@end
|
|
@ -1,14 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTMapAnnotation.h"
|
||||
|
||||
@implementation RCTMapAnnotation
|
||||
|
||||
@end
|
|
@ -1,14 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <React/RCTViewManager.h>
|
||||
|
||||
@interface RCTMapManager : RCTViewManager
|
||||
|
||||
@end
|
|
@ -1,434 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTMapManager.h"
|
||||
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTConvert+CoreLocation.h"
|
||||
#import "RCTConvert+MapKit.h"
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTMap.h"
|
||||
#import "RCTUtils.h"
|
||||
#import "UIView+React.h"
|
||||
#import "RCTMapAnnotation.h"
|
||||
#import "RCTMapOverlay.h"
|
||||
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
static NSString *const RCTMapViewKey = @"MapView";
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0
|
||||
|
||||
static NSString *const RCTMapPinRed = @"#ff3b30";
|
||||
static NSString *const RCTMapPinGreen = @"#4cd964";
|
||||
static NSString *const RCTMapPinPurple = @"#c969e0";
|
||||
|
||||
@implementation RCTConvert (MKPinAnnotationColor)
|
||||
|
||||
RCT_ENUM_CONVERTER(MKPinAnnotationColor, (@{
|
||||
RCTMapPinRed: @(MKPinAnnotationColorRed),
|
||||
RCTMapPinGreen: @(MKPinAnnotationColorGreen),
|
||||
RCTMapPinPurple: @(MKPinAnnotationColorPurple)
|
||||
}), MKPinAnnotationColorRed, unsignedIntegerValue)
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
@interface RCTMapAnnotationView : MKAnnotationView
|
||||
|
||||
@property (nonatomic, strong) UIView *contentView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTMapAnnotationView
|
||||
|
||||
- (void)setContentView:(UIView *)contentView
|
||||
{
|
||||
[_contentView removeFromSuperview];
|
||||
_contentView = contentView;
|
||||
[self addSubview:_contentView];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
self.bounds = (CGRect){
|
||||
CGPointZero,
|
||||
_contentView.frame.size,
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTMapManager() <MKMapViewDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTMapManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
RCTMap *map = [RCTMap new];
|
||||
map.delegate = self;
|
||||
return map;
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(showsUserLocation, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(showsPointsOfInterest, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(showsCompass, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(showsAnnotationCallouts, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(followUserLocation, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(pitchEnabled, BOOL)
|
||||
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, NSArray<RCTMapAnnotation *>)
|
||||
RCT_EXPORT_VIEW_PROPERTY(overlays, NSArray<RCTMapOverlay *>)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onAnnotationDragStateChange, RCTBubblingEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onAnnotationFocus, RCTBubblingEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onAnnotationBlur, RCTBubblingEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
|
||||
{
|
||||
#pragma unused (defaultView)
|
||||
if (json) {
|
||||
[view setRegion:[RCTConvert MKCoordinateRegion:json] animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark MKMapViewDelegate
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView didSelectAnnotationView:(MKAnnotationView *)view
|
||||
{
|
||||
// TODO: Remove deprecated onAnnotationPress API call later.
|
||||
if (mapView.onPress && [view.annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
|
||||
mapView.onPress(@{
|
||||
@"action": @"annotation-click",
|
||||
@"annotation": @{
|
||||
@"id": annotation.identifier,
|
||||
@"title": annotation.title ?: @"",
|
||||
@"subtitle": annotation.subtitle ?: @"",
|
||||
@"latitude": @(annotation.coordinate.latitude),
|
||||
@"longitude": @(annotation.coordinate.longitude)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ([view.annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
|
||||
if (mapView.onAnnotationFocus) {
|
||||
mapView.onAnnotationFocus(@{
|
||||
@"annotationId": annotation.identifier
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView didDeselectAnnotationView:(MKAnnotationView *)view
|
||||
{
|
||||
if ([view.annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
|
||||
if (mapView.onAnnotationBlur) {
|
||||
mapView.onAnnotationBlur(@{
|
||||
@"annotationId": annotation.identifier
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
- (void)mapView:(RCTMap *)mapView annotationView:(MKAnnotationView *)view
|
||||
didChangeDragState:(MKAnnotationViewDragState)newState
|
||||
fromOldState:(MKAnnotationViewDragState)oldState
|
||||
{
|
||||
static NSArray *states;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
states = @[@"idle", @"starting", @"dragging", @"canceling", @"ending"];
|
||||
});
|
||||
|
||||
if ([view.annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
|
||||
if (mapView.onAnnotationDragStateChange) {
|
||||
mapView.onAnnotationDragStateChange(@{
|
||||
@"state": states[newState],
|
||||
@"oldState": states[oldState],
|
||||
@"annotationId": annotation.identifier,
|
||||
@"latitude": @(annotation.coordinate.latitude),
|
||||
@"longitude": @(annotation.coordinate.longitude),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //TARGET_OS_TV
|
||||
|
||||
- (MKAnnotationView *)mapView:(RCTMap *)mapView
|
||||
viewForAnnotation:(RCTMapAnnotation *)annotation
|
||||
{
|
||||
if (![annotation isKindOfClass:[RCTMapAnnotation class]]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
MKAnnotationView *annotationView;
|
||||
if (annotation.viewIndex != NSNotFound &&
|
||||
annotation.viewIndex < mapView.reactSubviews.count) {
|
||||
|
||||
NSString *reuseIdentifier = NSStringFromClass([RCTMapAnnotationView class]);
|
||||
annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:reuseIdentifier];
|
||||
if (!annotationView) {
|
||||
annotationView = [[RCTMapAnnotationView alloc] initWithAnnotation:annotation
|
||||
reuseIdentifier:reuseIdentifier];
|
||||
}
|
||||
UIView *reactView = mapView.reactSubviews[annotation.viewIndex];
|
||||
((RCTMapAnnotationView *)annotationView).contentView = reactView;
|
||||
|
||||
} else if (annotation.image) {
|
||||
|
||||
NSString *reuseIdentifier = NSStringFromClass([MKAnnotationView class]);
|
||||
annotationView =
|
||||
[mapView dequeueReusableAnnotationViewWithIdentifier:reuseIdentifier] ?:
|
||||
[[MKAnnotationView alloc] initWithAnnotation:annotation
|
||||
reuseIdentifier:reuseIdentifier];
|
||||
annotationView.image = annotation.image;
|
||||
|
||||
} else {
|
||||
|
||||
NSString *reuseIdentifier = NSStringFromClass([MKPinAnnotationView class]);
|
||||
annotationView =
|
||||
[mapView dequeueReusableAnnotationViewWithIdentifier:reuseIdentifier] ?:
|
||||
[[MKPinAnnotationView alloc] initWithAnnotation:annotation
|
||||
reuseIdentifier:reuseIdentifier];
|
||||
((MKPinAnnotationView *)annotationView).animatesDrop = annotation.animateDrop;
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0
|
||||
|
||||
if (![annotationView respondsToSelector:@selector(pinTintColor)]) {
|
||||
NSString *hexColor = annotation.tintColor ?
|
||||
RCTColorToHexString(annotation.tintColor.CGColor) : RCTMapPinRed;
|
||||
((MKPinAnnotationView *)annotationView).pinColor =
|
||||
[RCTConvert MKPinAnnotationColor:hexColor];
|
||||
} else
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
((MKPinAnnotationView *)annotationView).pinTintColor =
|
||||
annotation.tintColor ?: [MKPinAnnotationView redPinColor];
|
||||
}
|
||||
}
|
||||
annotationView.canShowCallout = (annotation.title.length > 0);
|
||||
|
||||
if (annotation.leftCalloutViewIndex != NSNotFound &&
|
||||
annotation.leftCalloutViewIndex < mapView.reactSubviews.count) {
|
||||
annotationView.leftCalloutAccessoryView =
|
||||
mapView.reactSubviews[annotation.leftCalloutViewIndex];
|
||||
} else if (annotation.hasLeftCallout) {
|
||||
annotationView.leftCalloutAccessoryView =
|
||||
[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
|
||||
} else {
|
||||
annotationView.leftCalloutAccessoryView = nil;
|
||||
}
|
||||
|
||||
if (annotation.rightCalloutViewIndex != NSNotFound &&
|
||||
annotation.rightCalloutViewIndex < mapView.reactSubviews.count) {
|
||||
annotationView.rightCalloutAccessoryView =
|
||||
mapView.reactSubviews[annotation.rightCalloutViewIndex];
|
||||
} else if (annotation.hasRightCallout) {
|
||||
annotationView.rightCalloutAccessoryView =
|
||||
[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
|
||||
} else {
|
||||
annotationView.rightCalloutAccessoryView = nil;
|
||||
}
|
||||
|
||||
//http://stackoverflow.com/questions/32581049/mapkit-ios-9-detailcalloutaccessoryview-usage
|
||||
if ([annotationView respondsToSelector:@selector(detailCalloutAccessoryView)]) {
|
||||
if (annotation.detailCalloutViewIndex != NSNotFound &&
|
||||
annotation.detailCalloutViewIndex < mapView.reactSubviews.count) {
|
||||
UIView *calloutView = mapView.reactSubviews[annotation.detailCalloutViewIndex];
|
||||
NSLayoutConstraint *widthConstraint =
|
||||
[NSLayoutConstraint constraintWithItem:calloutView
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:nil
|
||||
attribute:NSLayoutAttributeNotAnAttribute
|
||||
multiplier:1
|
||||
constant:calloutView.frame.size.width];
|
||||
[calloutView addConstraint:widthConstraint];
|
||||
NSLayoutConstraint *heightConstraint =
|
||||
[NSLayoutConstraint constraintWithItem:calloutView
|
||||
attribute:NSLayoutAttributeHeight
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:nil
|
||||
attribute:NSLayoutAttributeNotAnAttribute
|
||||
multiplier:1
|
||||
constant:calloutView.frame.size.height];
|
||||
[calloutView addConstraint:heightConstraint];
|
||||
annotationView.detailCalloutAccessoryView = calloutView;
|
||||
} else {
|
||||
annotationView.detailCalloutAccessoryView = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
annotationView.draggable = annotation.draggable;
|
||||
#endif
|
||||
|
||||
return annotationView;
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView didAddAnnotationViews:(__unused NSArray *)views {
|
||||
if (mapView.showsAnnotationCallouts) {
|
||||
for (id<MKAnnotation> annotation in mapView.annotations) {
|
||||
[mapView selectAnnotation:annotation animated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (MKOverlayRenderer *)mapView:(__unused MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
|
||||
{
|
||||
RCTAssert([overlay isKindOfClass:[RCTMapOverlay class]], @"Overlay must be of type RCTMapOverlay");
|
||||
MKPolylineRenderer *polylineRenderer = [[MKPolylineRenderer alloc] initWithPolyline:overlay];
|
||||
polylineRenderer.strokeColor = [(RCTMapOverlay *)overlay strokeColor];
|
||||
polylineRenderer.lineWidth = [(RCTMapOverlay *)overlay lineWidth];
|
||||
return polylineRenderer;
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView annotationView:(MKAnnotationView *)view
|
||||
calloutAccessoryControlTapped:(UIControl *)control
|
||||
{
|
||||
if (mapView.onPress) {
|
||||
// Pass to JS
|
||||
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
|
||||
mapView.onPress(@{
|
||||
@"side": (control == view.leftCalloutAccessoryView) ? @"left" : @"right",
|
||||
@"action": @"callout-click",
|
||||
@"annotationId": annotation.identifier
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView didUpdateUserLocation:(MKUserLocation *)location
|
||||
{
|
||||
if (mapView.followUserLocation) {
|
||||
MKCoordinateRegion region;
|
||||
region.span.latitudeDelta = RCTMapDefaultSpan;
|
||||
region.span.longitudeDelta = RCTMapDefaultSpan;
|
||||
region.center = location.coordinate;
|
||||
[mapView setRegion:region animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView regionWillChangeAnimated:(__unused BOOL)animated
|
||||
{
|
||||
[self _regionChanged:mapView];
|
||||
|
||||
mapView.regionChangeObserveTimer =
|
||||
[NSTimer timerWithTimeInterval:RCTMapRegionChangeObserveInterval
|
||||
target:self
|
||||
selector:@selector(_onTick:)
|
||||
userInfo:@{ RCTMapViewKey: mapView }
|
||||
repeats:YES];
|
||||
|
||||
[[NSRunLoop mainRunLoop] addTimer:mapView.regionChangeObserveTimer
|
||||
forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
|
||||
- (void)mapView:(RCTMap *)mapView regionDidChangeAnimated:(__unused BOOL)animated
|
||||
{
|
||||
[mapView.regionChangeObserveTimer invalidate];
|
||||
mapView.regionChangeObserveTimer = nil;
|
||||
|
||||
[self _regionChanged:mapView];
|
||||
|
||||
// Don't send region did change events until map has
|
||||
// started rendering, as these won't represent the final location
|
||||
if (mapView.hasStartedRendering) {
|
||||
[self _emitRegionChangeEvent:mapView continuous:NO];
|
||||
};
|
||||
}
|
||||
|
||||
- (void)mapViewWillStartRenderingMap:(RCTMap *)mapView
|
||||
{
|
||||
mapView.hasStartedRendering = YES;
|
||||
[self _emitRegionChangeEvent:mapView continuous:NO];
|
||||
}
|
||||
|
||||
#pragma mark Private
|
||||
|
||||
- (void)_onTick:(NSTimer *)timer
|
||||
{
|
||||
[self _regionChanged:timer.userInfo[RCTMapViewKey]];
|
||||
}
|
||||
|
||||
- (void)_regionChanged:(RCTMap *)mapView
|
||||
{
|
||||
BOOL needZoom = NO;
|
||||
CGFloat newLongitudeDelta = 0.0f;
|
||||
MKCoordinateRegion region = mapView.region;
|
||||
|
||||
// On iOS 7, it's possible that we observe invalid locations during
|
||||
// initialization of the map. Filter those out.
|
||||
if (!CLLocationCoordinate2DIsValid(region.center)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculation on float is not 100% accurate. If user zoom to max/min and then
|
||||
// move, it's likely the map will auto zoom to max/min from time to time.
|
||||
// So let's try to make map zoom back to 99% max or 101% min so that there is
|
||||
// some buffer, and moving the map won't constantly hit the max/min bound.
|
||||
if (mapView.maxDelta > FLT_EPSILON &&
|
||||
region.span.longitudeDelta > mapView.maxDelta) {
|
||||
needZoom = YES;
|
||||
newLongitudeDelta = mapView.maxDelta * (1 - RCTMapZoomBoundBuffer);
|
||||
} else if (mapView.minDelta > FLT_EPSILON &&
|
||||
region.span.longitudeDelta < mapView.minDelta) {
|
||||
needZoom = YES;
|
||||
newLongitudeDelta = mapView.minDelta * (1 + RCTMapZoomBoundBuffer);
|
||||
}
|
||||
if (needZoom) {
|
||||
region.span.latitudeDelta =
|
||||
region.span.latitudeDelta / region.span.longitudeDelta * newLongitudeDelta;
|
||||
region.span.longitudeDelta = newLongitudeDelta;
|
||||
mapView.region = region;
|
||||
}
|
||||
|
||||
// Continously observe region changes
|
||||
[self _emitRegionChangeEvent:mapView continuous:YES];
|
||||
}
|
||||
|
||||
- (void)_emitRegionChangeEvent:(RCTMap *)mapView continuous:(BOOL)continuous
|
||||
{
|
||||
if (mapView.onChange) {
|
||||
MKCoordinateRegion region = mapView.region;
|
||||
if (!CLLocationCoordinate2DIsValid(region.center)) {
|
||||
return;
|
||||
}
|
||||
|
||||
mapView.onChange(@{
|
||||
@"continuous": @(continuous),
|
||||
@"region": @{
|
||||
@"latitude": @(RCTZeroIfNaN(region.center.latitude)),
|
||||
@"longitude": @(RCTZeroIfNaN(region.center.longitude)),
|
||||
@"latitudeDelta": @(RCTZeroIfNaN(region.span.latitudeDelta)),
|
||||
@"longitudeDelta": @(RCTZeroIfNaN(region.span.longitudeDelta)),
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,18 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
@interface RCTMapOverlay : MKPolyline <MKAnnotation>
|
||||
|
||||
@property (nonatomic, copy) NSString *identifier;
|
||||
@property (nonatomic, strong) UIColor *strokeColor;
|
||||
@property (nonatomic, assign) CGFloat lineWidth;
|
||||
|
||||
@end
|
|
@ -1,14 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTMapOverlay.h"
|
||||
|
||||
@implementation RCTMapOverlay
|
||||
|
||||
@end
|
|
@ -18,7 +18,6 @@ const components = [
|
|||
'../Libraries/Image/Image.ios.js',
|
||||
'../Libraries/Components/Keyboard/KeyboardAvoidingView.js',
|
||||
'../Libraries/CustomComponents/ListView/ListView.js',
|
||||
'../Libraries/Components/MapView/MapView.js',
|
||||
'../Libraries/Modal/Modal.js',
|
||||
'../Libraries/CustomComponents/Navigator/Navigator.js',
|
||||
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
|
||||
|
|
Loading…
Reference in New Issue