-
-
Notifications
You must be signed in to change notification settings - Fork 864
/
Copy pathBugReportExample.js
124 lines (118 loc) · 2.72 KB
/
BugReportExample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import React from 'react';
import { Button } from 'react-native';
import {
Images,
MapView,
ShapeSource,
SymbolLayer,
CircleLayer,
Camera,
VectorSource,
LineLayer,
} from '@rnmapbox/maps';
const styles = {
mapView: { flex: 1 },
circleLayer: {
circleRadiusTransition: { duration: 5000, delay: 0 },
circleColor: '#ff0000',
},
};
const features = {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
id: 'a-feature',
properties: {
icon: 'example',
text: 'example-icon-and-label',
},
geometry: {
type: 'Point',
coordinates: [-74.00597, 40.71427],
},
},
{
type: 'Feature',
id: 'b-feature',
properties: {
text: 'just-label',
},
geometry: {
type: 'Point',
coordinates: [-74.001097, 40.71527],
},
},
{
type: 'Feature',
id: 'c-feature',
properties: {
icon: 'example',
},
geometry: {
type: 'Point',
coordinates: [-74.00697, 40.72427],
},
},
],
};
class BugReportExample extends React.Component {
state = {
radius: 20,
};
render() {
const circleLayerStyle = {
...styles.circleLayer,
...{ circleRadius: this.state.radius },
};
return (
<>
<MapView style={styles.mapView}>
<Camera
defaultSettings={{
centerCoordinate: [-87.622088, 41.878781],
zoomLevel: 10,
}}
/>
<Images images={{ example: require('../assets/example.png') }} />
<VectorSource
id="mapillary"
tileUrlTemplates={[
'https://tiles.mapillary.com/maps/vtp/mly1_public/2/{z}/{x}/{y}?access_token=MLY|4142433049200173|72206abe5035850d6743b23a49c41333'.replaceAll(
'|',
'%7C',
),
]}
>
<LineLayer
id="mapillary-lines"
sourceLayerID="sequence"
style={{
lineCap: 'round',
lineJoin: 'round',
lineOpacity: 0.6,
lineColor: 'rgb(53, 175, 109)',
lineWidth: 2.0,
}}
/>
</VectorSource>
<ShapeSource id={'shape-source-id-0'} shape={features}>
<CircleLayer
id={'circle-layer'}
style={circleLayerStyle}
slot={'bottom'}
/>
<SymbolLayer
id="symbol-id"
style={{
iconImage: ['get', 'icon'],
}}
slot={'middle'}
/>
</ShapeSource>
</MapView>
</>
);
}
}
export default BugReportExample;