react-native-maps 0.29.4 → 0.31.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/index.d.ts +21 -5
- package/index.js +1 -3
- package/lib/android/build.gradle +3 -1
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapTileProvider.java +515 -0
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapTileWorker.java +122 -0
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTile.java +124 -55
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTileManager.java +34 -0
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +19 -4
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTile.java +31 -87
- package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTileManager.java +22 -2
- package/lib/components/AnimatedRegion.js +67 -101
- package/lib/components/Geojson.js +67 -40
- package/lib/components/MapCallout.js +3 -5
- package/lib/components/MapCalloutSubview.js +3 -5
- package/lib/components/MapCircle.js +6 -6
- package/lib/components/MapHeatmap.js +5 -7
- package/lib/components/MapLocalTile.js +2 -6
- package/lib/components/MapMarker.js +9 -9
- package/lib/components/MapOverlay.js +3 -2
- package/lib/components/MapPolygon.js +6 -6
- package/lib/components/MapPolyline.js +6 -7
- package/lib/components/MapUrlTile.js +56 -8
- package/lib/components/MapView.js +16 -16
- package/lib/components/MapWMSTile.js +51 -8
- package/lib/components/decorateMapComponent.js +1 -1
- package/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h +1 -0
- package/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m +8 -0
- package/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -0
- package/lib/ios/AirMaps/AIRMapManager.m +21 -3
- package/lib/ios/AirMaps/AIRMapMarkerManager.m +1 -0
- package/lib/ios/AirMaps/AIRMapPolyline.h +1 -0
- package/lib/ios/AirMaps/AIRMapPolyline.m +14 -1
- package/lib/ios/AirMaps/AIRMapPolylineManager.m +1 -0
- package/lib/ios/AirMaps/AIRMapUrlTile.h +22 -4
- package/lib/ios/AirMaps/AIRMapUrlTile.m +124 -34
- package/lib/ios/AirMaps/AIRMapUrlTileCachedOverlay.h +17 -0
- package/lib/ios/AirMaps/AIRMapUrlTileCachedOverlay.m +235 -0
- package/lib/ios/AirMaps/AIRMapUrlTileManager.m +6 -1
- package/lib/ios/AirMaps/AIRMapWMSTile.h +10 -16
- package/lib/ios/AirMaps/AIRMapWMSTile.m +68 -101
- package/lib/ios/AirMaps/AIRMapWMSTileManager.m +6 -1
- package/lib/ios/AirMaps.xcodeproj/project.pbxproj +7 -1
- package/package.json +44 -6
- package/react-native-google-maps.podspec +3 -3
- package/react-native-maps.podspec +1 -1
- package/.eslintrc +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -111
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -32
- package/.github/ISSUE_TEMPLATE.md +0 -5
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -53
- package/.github/stale.yml +0 -17
- package/.github/workflows/base.yml +0 -21
- package/.prettierrc +0 -4
- package/CHANGELOG.md +0 -761
- package/docs/callout.md +0 -38
- package/docs/circle.md +0 -28
- package/docs/examples-setup.md +0 -17
- package/docs/geojson.md +0 -50
- package/docs/heatmap.md +0 -32
- package/docs/installation.md +0 -347
- package/docs/mapview.md +0 -252
- package/docs/marker.md +0 -84
- package/docs/overlay.md +0 -27
- package/docs/polygon.md +0 -34
- package/docs/polyline.md +0 -65
- package/enable-google-maps +0 -15
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ColorPropType,
|
|
5
|
+
ViewPropTypes,
|
|
6
|
+
} from 'deprecated-react-native-prop-types';
|
|
4
7
|
import decorateMapComponent, {
|
|
5
8
|
USES_DEFAULT_IMPLEMENTATION,
|
|
6
9
|
SUPPORTED,
|
|
7
10
|
} from './decorateMapComponent';
|
|
8
11
|
|
|
9
|
-
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
10
|
-
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
11
|
-
|
|
12
12
|
const propTypes = {
|
|
13
|
-
...
|
|
13
|
+
...ViewPropTypes,
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* An array of coordinates to describe the polygon
|
|
@@ -98,7 +98,6 @@ const propTypes = {
|
|
|
98
98
|
* points on the Earth's surface. The geodesic curve is constructed assuming the Earth is
|
|
99
99
|
* a sphere.
|
|
100
100
|
*
|
|
101
|
-
* @platform android
|
|
102
101
|
*/
|
|
103
102
|
geodesic: PropTypes.bool,
|
|
104
103
|
|
|
@@ -147,7 +146,7 @@ class MapPolyline extends React.Component {
|
|
|
147
146
|
return (
|
|
148
147
|
<AIRMapPolyline
|
|
149
148
|
{...this.props}
|
|
150
|
-
ref={ref => {
|
|
149
|
+
ref={(ref) => {
|
|
151
150
|
this.polyline = ref;
|
|
152
151
|
}}
|
|
153
152
|
/>
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { ViewPropTypes, View } from 'react-native';
|
|
3
|
+
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
5
4
|
|
|
6
5
|
import decorateMapComponent, {
|
|
7
6
|
USES_DEFAULT_IMPLEMENTATION,
|
|
8
7
|
SUPPORTED,
|
|
9
8
|
} from './decorateMapComponent';
|
|
10
9
|
|
|
11
|
-
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
12
|
-
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
13
|
-
|
|
14
10
|
const propTypes = {
|
|
15
|
-
...
|
|
11
|
+
...ViewPropTypes,
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
|
|
@@ -28,12 +24,20 @@ const propTypes = {
|
|
|
28
24
|
* @platform android
|
|
29
25
|
*/
|
|
30
26
|
zIndex: PropTypes.number,
|
|
27
|
+
|
|
31
28
|
/**
|
|
32
29
|
* The maximum zoom level for this tile overlay.
|
|
33
30
|
*
|
|
34
31
|
*/
|
|
35
32
|
maximumZ: PropTypes.number,
|
|
36
33
|
|
|
34
|
+
/**
|
|
35
|
+
* (Optional) The maximum native zoom level for this tile overlay. Tiles are auto-scaled for higher
|
|
36
|
+
* zoom levels.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
maximumNativeZ: PropTypes.number,
|
|
40
|
+
|
|
37
41
|
/**
|
|
38
42
|
* The minimum zoom level for this tile overlay.
|
|
39
43
|
*
|
|
@@ -48,12 +52,20 @@ const propTypes = {
|
|
|
48
52
|
shouldReplaceMapContent: PropTypes.bool,
|
|
49
53
|
|
|
50
54
|
/**
|
|
51
|
-
* (Optional) Tile size
|
|
55
|
+
* (Optional) Tile size only, default size is 256 (for tiles of 256 * 256 pixels)
|
|
52
56
|
*
|
|
53
|
-
* @platform ios
|
|
54
57
|
*/
|
|
55
58
|
tileSize: PropTypes.number,
|
|
56
59
|
|
|
60
|
+
/**
|
|
61
|
+
* (Optional) Doubles tile size from 256 to 512 utilising higher zoom levels i.e.
|
|
62
|
+
* loading 4 higher zoom level tiles and combining them for one high-resolution
|
|
63
|
+
* tile. iOS does this automatically, even if it is not desirable always.
|
|
64
|
+
*
|
|
65
|
+
* @platform android
|
|
66
|
+
*/
|
|
67
|
+
doubleTileSize: PropTypes.bool,
|
|
68
|
+
|
|
57
69
|
/**
|
|
58
70
|
*
|
|
59
71
|
* Allow tiles using the TMS coordinate system (origin bottom left)
|
|
@@ -61,6 +73,42 @@ const propTypes = {
|
|
|
61
73
|
*
|
|
62
74
|
*/
|
|
63
75
|
flipY: PropTypes.bool,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* (Optional) Enable caching of tiles in the specified directory. Directory
|
|
80
|
+
* can be specified either as a normal path or in URL format (file://). Tiles
|
|
81
|
+
* are stored in tileCachePath directory as follows "/{z}/{x}/{y}" i.e. in
|
|
82
|
+
* sub-directories 2-levels deep, filename tile y-coordinate without any
|
|
83
|
+
* filetype-extension.
|
|
84
|
+
* NB! All cache management needs to be implemented by client e.g. deleting tiles
|
|
85
|
+
* to manage use of storage space etc.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
tileCachePath: PropTypes.string,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* (Optional) Defines how maximum age in seconds for cached tile before they
|
|
92
|
+
* are refreshed. NB! Refresh logic is "serve-stale-while-refresh" i.e. to
|
|
93
|
+
* ensure map availability a stale (over max age) tile is served while a tile
|
|
94
|
+
* refresh process is started in the background.
|
|
95
|
+
*/
|
|
96
|
+
tileCacheMaxAge: PropTypes.number,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* (Optional) Sets offline-mode. In offline-mode tiles are not fetched from
|
|
100
|
+
* the tile servers, rather only tiles stored in the cache directory are used.
|
|
101
|
+
* Furthermore automated tile scaling is activated: if tile at a desired zoom
|
|
102
|
+
* level is not found from the cache directory, then lower zoom level tile is
|
|
103
|
+
* used (until minimumZ) and scaled.
|
|
104
|
+
*/
|
|
105
|
+
offlineMode: PropTypes.bool,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* (Optional) Map layer opacity. Value between 0 - 1, with 0 meaning fully
|
|
109
|
+
* transparent.
|
|
110
|
+
*/
|
|
111
|
+
opacity: PropTypes.number,
|
|
64
112
|
};
|
|
65
113
|
|
|
66
114
|
class MapUrlTile extends React.Component {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import {
|
|
4
|
-
EdgeInsetsPropType,
|
|
5
|
-
PointPropType,
|
|
6
4
|
Platform,
|
|
7
5
|
Animated as RNAnimated,
|
|
8
6
|
requireNativeComponent,
|
|
9
7
|
NativeModules,
|
|
10
|
-
ColorPropType,
|
|
11
8
|
findNodeHandle,
|
|
12
|
-
ViewPropTypes,
|
|
13
|
-
View,
|
|
14
9
|
} from 'react-native';
|
|
10
|
+
import {
|
|
11
|
+
EdgeInsetsPropType,
|
|
12
|
+
PointPropType,
|
|
13
|
+
ColorPropType,
|
|
14
|
+
ViewPropTypes,
|
|
15
|
+
} from 'deprecated-react-native-prop-types';
|
|
15
16
|
import MapMarker from './MapMarker';
|
|
16
17
|
import MapPolyline from './MapPolyline';
|
|
17
18
|
import MapPolygon from './MapPolygon';
|
|
@@ -65,11 +66,8 @@ const CameraShape = PropTypes.shape({
|
|
|
65
66
|
zoom: PropTypes.number.isRequired,
|
|
66
67
|
});
|
|
67
68
|
|
|
68
|
-
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
69
|
-
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
70
|
-
|
|
71
69
|
const propTypes = {
|
|
72
|
-
...
|
|
70
|
+
...ViewPropTypes,
|
|
73
71
|
/**
|
|
74
72
|
* When provider is "google", we will use GoogleMaps.
|
|
75
73
|
* Any value other than "google" will default to using
|
|
@@ -81,7 +79,7 @@ const propTypes = {
|
|
|
81
79
|
* Used to style and layout the `MapView`. See `StyleSheet.js` and
|
|
82
80
|
* `ViewStylePropTypes.js` for more info.
|
|
83
81
|
*/
|
|
84
|
-
style:
|
|
82
|
+
style: ViewPropTypes.style,
|
|
85
83
|
|
|
86
84
|
/**
|
|
87
85
|
* A json object that describes the style of the map. This is transformed to a string
|
|
@@ -1026,12 +1024,14 @@ class MapView extends React.Component {
|
|
|
1026
1024
|
) {
|
|
1027
1025
|
props.mapType = MAP_TYPES.standard;
|
|
1028
1026
|
}
|
|
1029
|
-
|
|
1027
|
+
if (props.onPanDrag) {
|
|
1028
|
+
props.handlePanDrag = !!props.onPanDrag;
|
|
1029
|
+
}
|
|
1030
1030
|
} else {
|
|
1031
1031
|
props = {
|
|
1032
1032
|
style: this.props.style,
|
|
1033
1033
|
region: null,
|
|
1034
|
-
initialRegion: null,
|
|
1034
|
+
initialRegion: this.props.initialRegion || null,
|
|
1035
1035
|
onMarkerPress: this._onMarkerPress,
|
|
1036
1036
|
onChange: this._onChange,
|
|
1037
1037
|
onMapReady: this._onMapReady,
|
|
@@ -1042,7 +1042,7 @@ class MapView extends React.Component {
|
|
|
1042
1042
|
if (Platform.OS === 'android' && this.props.liteMode) {
|
|
1043
1043
|
return (
|
|
1044
1044
|
<AIRMapLite
|
|
1045
|
-
ref={ref => {
|
|
1045
|
+
ref={(ref) => {
|
|
1046
1046
|
this.map = ref;
|
|
1047
1047
|
}}
|
|
1048
1048
|
{...props}
|
|
@@ -1054,7 +1054,7 @@ class MapView extends React.Component {
|
|
|
1054
1054
|
|
|
1055
1055
|
return (
|
|
1056
1056
|
<AIRMap
|
|
1057
|
-
ref={ref => {
|
|
1057
|
+
ref={(ref) => {
|
|
1058
1058
|
this.map = ref;
|
|
1059
1059
|
}}
|
|
1060
1060
|
{...props}
|
|
@@ -1069,7 +1069,7 @@ MapView.childContextTypes = childContextTypes;
|
|
|
1069
1069
|
|
|
1070
1070
|
MapView.MAP_TYPES = MAP_TYPES;
|
|
1071
1071
|
|
|
1072
|
-
const nativeComponent = Component =>
|
|
1072
|
+
const nativeComponent = (Component) =>
|
|
1073
1073
|
requireNativeComponent(Component, MapView, {
|
|
1074
1074
|
nativeOnly: {
|
|
1075
1075
|
onChange: true,
|
|
@@ -1090,7 +1090,7 @@ if (Platform.OS === 'android') {
|
|
|
1090
1090
|
'react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.'
|
|
1091
1091
|
);
|
|
1092
1092
|
}
|
|
1093
|
-
const getAirMapComponent = provider => airMaps[provider || 'default'];
|
|
1093
|
+
const getAirMapComponent = (provider) => airMaps[provider || 'default'];
|
|
1094
1094
|
|
|
1095
1095
|
let AIRMapLite;
|
|
1096
1096
|
if (!NativeModules.UIManager.getViewManagerConfig) {
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { ViewPropTypes, View } from 'react-native';
|
|
3
|
+
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
5
4
|
|
|
6
5
|
import decorateMapComponent, {
|
|
7
6
|
USES_DEFAULT_IMPLEMENTATION,
|
|
8
7
|
SUPPORTED,
|
|
9
8
|
} from './decorateMapComponent';
|
|
10
9
|
|
|
11
|
-
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
12
|
-
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
13
|
-
|
|
14
10
|
const propTypes = {
|
|
15
|
-
...
|
|
11
|
+
...ViewPropTypes,
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* The url template of the tile server. The patterns {minX} {maxX} {minY} {maxY} {width} {height}
|
|
@@ -29,12 +25,20 @@ const propTypes = {
|
|
|
29
25
|
* @platform android
|
|
30
26
|
*/
|
|
31
27
|
zIndex: PropTypes.number,
|
|
28
|
+
|
|
32
29
|
/**
|
|
33
30
|
* The maximum zoom level for this tile overlay.
|
|
34
31
|
*
|
|
35
32
|
*/
|
|
36
33
|
maximumZ: PropTypes.number,
|
|
37
34
|
|
|
35
|
+
/**
|
|
36
|
+
* (Optional) The maximum native zoom level for this tile overlay. Tiles are auto-scaled for higher
|
|
37
|
+
* zoom levels.
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
maximumNativeZ: PropTypes.number,
|
|
41
|
+
|
|
38
42
|
/**
|
|
39
43
|
* The minimum zoom level for this tile overlay.
|
|
40
44
|
*
|
|
@@ -47,15 +51,54 @@ const propTypes = {
|
|
|
47
51
|
* @platform ios
|
|
48
52
|
*/
|
|
49
53
|
shouldReplaceMapContent: PropTypes.bool,
|
|
54
|
+
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
56
|
+
* (Optional) Tile size only, default size is 256 (for tiles of 256 * 256 pixels)
|
|
52
57
|
*
|
|
53
58
|
*/
|
|
54
59
|
tileSize: PropTypes.number,
|
|
55
60
|
|
|
56
61
|
/**
|
|
57
|
-
* opacity. between 0 - 1
|
|
58
62
|
*
|
|
63
|
+
* Allow tiles using the TMS coordinate system (origin bottom left)
|
|
64
|
+
* to be used, and displayed at their correct coordinates
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
flipY: PropTypes.bool,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* (Optional) Enable caching of tiles in the specified directory. Directory
|
|
72
|
+
* can be specified either as a normal path or in URL format (file://). Tiles
|
|
73
|
+
* are stored in tileCachePath directory as follows "/{z}/{x}/{y}" i.e. in
|
|
74
|
+
* sub-directories 2-levels deep, filename tile y-coordinate without any
|
|
75
|
+
* filetype-extension.
|
|
76
|
+
* NB! All cache management needs to be implemented by client e.g. deleting tiles
|
|
77
|
+
* to manage use of storage space etc.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
tileCachePath: PropTypes.string,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* (Optional) Defines how maximum age in seconds for cached tile before they
|
|
84
|
+
* are refreshed. NB! Refresh logic is "serve-stale-while-refresh" i.e. to
|
|
85
|
+
* ensure map availability a stale (over max age) tile is served while a tile
|
|
86
|
+
* refresh process is started in the background.
|
|
87
|
+
*/
|
|
88
|
+
tileCacheMaxAge: PropTypes.number,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* (Optional) Sets offline-mode. In offline-mode tiles are not fetched from
|
|
92
|
+
* the tile servers, rather only tiles stored in the cache directory are used.
|
|
93
|
+
* Furthermore automated tile scaling is activated: if tile at a desired zoom
|
|
94
|
+
* level is not found from the cache directory, then lower zoom level tile is
|
|
95
|
+
* used (until minimumZ) and scaled.
|
|
96
|
+
*/
|
|
97
|
+
offlineMode: PropTypes.bool,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* (Optional) Map layer opacity. Value between 0 - 1, with 0 meaning fully
|
|
101
|
+
* transparent.
|
|
59
102
|
*/
|
|
60
103
|
opacity: PropTypes.number,
|
|
61
104
|
};
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
@property (nonatomic, assign) NSInteger zIndex;
|
|
37
37
|
@property (nonatomic, assign) double opacity;
|
|
38
38
|
@property (nonatomic, assign) BOOL draggable;
|
|
39
|
+
@property (nonatomic, assign) BOOL tappable;
|
|
39
40
|
@property (nonatomic, assign) BOOL tracksViewChanges;
|
|
40
41
|
@property (nonatomic, assign) BOOL tracksInfoWindowChanges;
|
|
41
42
|
|
|
@@ -391,6 +391,14 @@ CGRect unionRect(CGRect a, CGRect b) {
|
|
|
391
391
|
return _realMarker.draggable;
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
- (void)setTappable:(BOOL)tappable {
|
|
395
|
+
_realMarker.tappable = tappable;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
- (BOOL)tappable {
|
|
399
|
+
return _realMarker.tappable;
|
|
400
|
+
}
|
|
401
|
+
|
|
394
402
|
- (void)setFlat:(BOOL)flat {
|
|
395
403
|
_realMarker.flat = flat;
|
|
396
404
|
}
|
|
@@ -44,6 +44,7 @@ RCT_EXPORT_VIEW_PROPERTY(anchor, CGPoint)
|
|
|
44
44
|
RCT_EXPORT_VIEW_PROPERTY(calloutAnchor, CGPoint)
|
|
45
45
|
RCT_EXPORT_VIEW_PROPERTY(zIndex, NSInteger)
|
|
46
46
|
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
|
|
47
|
+
RCT_EXPORT_VIEW_PROPERTY(tappable, BOOL)
|
|
47
48
|
RCT_EXPORT_VIEW_PROPERTY(flat, BOOL)
|
|
48
49
|
RCT_EXPORT_VIEW_PROPERTY(tracksViewChanges, BOOL)
|
|
49
50
|
RCT_EXPORT_VIEW_PROPERTY(tracksInfoWindowChanges, BOOL)
|
|
@@ -734,7 +734,11 @@ RCT_EXPORT_METHOD(getAddressFromCoordinates:(nonnull NSNumber *)reactTag
|
|
|
734
734
|
if (CGPathContainsPoint(mpr, NULL, mapPointAsCGP, FALSE)) {
|
|
735
735
|
id event = @{
|
|
736
736
|
@"action": @"polygon-press",
|
|
737
|
-
|
|
737
|
+
@"coordinate": @{
|
|
738
|
+
@"latitude": @(tapCoordinate.latitude),
|
|
739
|
+
@"longitude": @(tapCoordinate.longitude),
|
|
740
|
+
},
|
|
741
|
+
};
|
|
738
742
|
polygon.onPress(event);
|
|
739
743
|
}
|
|
740
744
|
|
|
@@ -774,8 +778,13 @@ RCT_EXPORT_METHOD(getAddressFromCoordinates:(nonnull NSNumber *)reactTag
|
|
|
774
778
|
}
|
|
775
779
|
|
|
776
780
|
if (nearestDistance <= maxMeters) {
|
|
781
|
+
AIRMapCoordinate *firstCoord = nearestPolyline.coordinates.firstObject;
|
|
777
782
|
id event = @{
|
|
778
783
|
@"action": @"polyline-press",
|
|
784
|
+
@"coordinate": @{
|
|
785
|
+
@"latitude": @(firstCoord.coordinate.latitude),
|
|
786
|
+
@"longitude": @(firstCoord.coordinate.longitude)
|
|
787
|
+
}
|
|
779
788
|
};
|
|
780
789
|
nearestPolyline.onPress(event);
|
|
781
790
|
}
|
|
@@ -1018,6 +1027,7 @@ static int kDragCenterContext;
|
|
|
1018
1027
|
@"accuracy": @(location.location.horizontalAccuracy),
|
|
1019
1028
|
@"altitudeAccuracy": @(location.location.verticalAccuracy),
|
|
1020
1029
|
@"speed": @(location.location.speed),
|
|
1030
|
+
@"heading": @(location.location.course),
|
|
1021
1031
|
}
|
|
1022
1032
|
};
|
|
1023
1033
|
|
|
@@ -1040,7 +1050,11 @@ static int kDragCenterContext;
|
|
|
1040
1050
|
|
|
1041
1051
|
- (void)mapView:(AIRMap *)mapView regionWillChangeAnimated:(__unused BOOL)animated
|
|
1042
1052
|
{
|
|
1043
|
-
|
|
1053
|
+
// Don't send region did change events until map has
|
|
1054
|
+
// started rendering, as these won't represent the final location
|
|
1055
|
+
if(mapView.hasStartedRendering){
|
|
1056
|
+
[self _regionChanged:mapView];
|
|
1057
|
+
}
|
|
1044
1058
|
|
|
1045
1059
|
AIRWeakTimerReference *weakTarget = [[AIRWeakTimerReference alloc] initWithTarget:self andSelector:@selector(_onTick:)];
|
|
1046
1060
|
|
|
@@ -1059,7 +1073,11 @@ static int kDragCenterContext;
|
|
|
1059
1073
|
[mapView.regionChangeObserveTimer invalidate];
|
|
1060
1074
|
mapView.regionChangeObserveTimer = nil;
|
|
1061
1075
|
|
|
1062
|
-
|
|
1076
|
+
// Don't send region did change events until map has
|
|
1077
|
+
// started rendering, as these won't represent the final location
|
|
1078
|
+
if(mapView.hasStartedRendering){
|
|
1079
|
+
[self _regionChanged:mapView];
|
|
1080
|
+
}
|
|
1063
1081
|
|
|
1064
1082
|
if (zoomLevel < mapView.minZoomLevel) {
|
|
1065
1083
|
[self setCenterCoordinate:[mapView centerCoordinate] zoomLevel:mapView.minZoomLevel animated:TRUE mapView:mapView];
|
|
@@ -45,6 +45,7 @@ RCT_EXPORT_VIEW_PROPERTY(pinColor, UIColor)
|
|
|
45
45
|
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
|
|
46
46
|
RCT_EXPORT_VIEW_PROPERTY(zIndex, NSInteger)
|
|
47
47
|
RCT_EXPORT_VIEW_PROPERTY(opacity, double)
|
|
48
|
+
RCT_EXPORT_VIEW_PROPERTY(isPreselected, BOOL)
|
|
48
49
|
|
|
49
50
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
50
51
|
RCT_EXPORT_VIEW_PROPERTY(onSelect, RCTDirectEventBlock)
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
@property (nonatomic, assign) CGLineJoin lineJoin;
|
|
33
33
|
@property (nonatomic, assign) CGFloat lineDashPhase;
|
|
34
34
|
@property (nonatomic, strong) NSArray <NSNumber *> *lineDashPattern;
|
|
35
|
+
@property (nonatomic, assign) BOOL geodesic;
|
|
35
36
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
36
37
|
|
|
37
38
|
#pragma mark MKOverlay protocol
|
|
@@ -60,6 +60,14 @@
|
|
|
60
60
|
[self update];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
-(void)setGeodesic:(BOOL)geodesic
|
|
64
|
+
{
|
|
65
|
+
_geodesic = geodesic;
|
|
66
|
+
if(_coordinates){
|
|
67
|
+
[self setCoordinates:_coordinates];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
63
71
|
- (void)setCoordinates:(NSArray<AIRMapCoordinate *> *)coordinates {
|
|
64
72
|
_coordinates = coordinates;
|
|
65
73
|
CLLocationCoordinate2D coords[coordinates.count];
|
|
@@ -67,7 +75,12 @@
|
|
|
67
75
|
{
|
|
68
76
|
coords[i] = coordinates[i].coordinate;
|
|
69
77
|
}
|
|
70
|
-
|
|
78
|
+
if(_geodesic){
|
|
79
|
+
self.polyline = [MKGeodesicPolyline polylineWithCoordinates:coords count:coordinates.count];
|
|
80
|
+
} else {
|
|
81
|
+
self.polyline = [MKPolyline polylineWithCoordinates:coords count:coordinates.count];
|
|
82
|
+
}
|
|
83
|
+
|
|
71
84
|
self.renderer = [self createRenderer];
|
|
72
85
|
[self update];
|
|
73
86
|
}
|
|
@@ -42,6 +42,7 @@ RCT_EXPORT_VIEW_PROPERTY(lineJoin, CGLineJoin)
|
|
|
42
42
|
RCT_EXPORT_VIEW_PROPERTY(miterLimit, CGFloat)
|
|
43
43
|
RCT_EXPORT_VIEW_PROPERTY(lineDashPhase, CGFloat)
|
|
44
44
|
RCT_EXPORT_VIEW_PROPERTY(lineDashPattern, NSArray)
|
|
45
|
+
RCT_EXPORT_VIEW_PROPERTY(geodesic, BOOL)
|
|
45
46
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
46
47
|
|
|
47
48
|
@end
|
|
@@ -15,19 +15,37 @@
|
|
|
15
15
|
#import "AIRMapCoordinate.h"
|
|
16
16
|
#import "AIRMap.h"
|
|
17
17
|
#import "RCTConvert+AirMap.h"
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
#import "AIRMapUrlTileCachedOverlay.h"
|
|
19
|
+
|
|
20
|
+
@interface AIRMapUrlTile : MKAnnotationView <MKOverlay> {
|
|
21
|
+
BOOL _urlTemplateSet;
|
|
22
|
+
BOOL _tileSizeSet;
|
|
23
|
+
BOOL _flipYSet;
|
|
24
|
+
BOOL _tileCachePathSet;
|
|
25
|
+
BOOL _tileCacheMaxAgeSet;
|
|
26
|
+
BOOL _maximumNativeZSet;
|
|
27
|
+
BOOL _cachedOverlayCreated;
|
|
28
|
+
BOOL _opacitySet;
|
|
29
|
+
}
|
|
20
30
|
|
|
21
31
|
@property (nonatomic, weak) AIRMap *map;
|
|
22
32
|
|
|
23
|
-
@property (nonatomic, strong)
|
|
33
|
+
@property (nonatomic, strong) AIRMapUrlTileCachedOverlay *tileOverlay;
|
|
24
34
|
@property (nonatomic, strong) MKTileOverlayRenderer *renderer;
|
|
25
35
|
@property (nonatomic, copy) NSString *urlTemplate;
|
|
26
36
|
@property NSInteger maximumZ;
|
|
37
|
+
@property NSInteger maximumNativeZ;
|
|
27
38
|
@property NSInteger minimumZ;
|
|
28
39
|
@property BOOL flipY;
|
|
29
40
|
@property BOOL shouldReplaceMapContent;
|
|
30
|
-
@property
|
|
41
|
+
@property NSInteger tileSize;
|
|
42
|
+
@property (nonatomic, copy) NSString *tileCachePath;
|
|
43
|
+
@property NSInteger tileCacheMaxAge;
|
|
44
|
+
@property BOOL offlineMode;
|
|
45
|
+
@property CGFloat opacity;
|
|
46
|
+
|
|
47
|
+
- (void)updateProperties;
|
|
48
|
+
- (void)update;
|
|
31
49
|
|
|
32
50
|
#pragma mark MKOverlay protocol
|
|
33
51
|
|