-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (41 loc) · 1.24 KB
/
index.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
import React from 'react'
import MapboxGL from '@mapbox/react-native-mapbox-gl'
export default class extends React.Component {
render(){
const coordinates = [];
for(let i=0;i<1000;i++){
const lat = Math.floor((Math.random()-0.5)*360);
const lng = Math.floor((Math.random()-0.5)*360);
coordinates.push([lat,lng])
}
const geoJSON = {
"type": "Feature",
"properties": {
},
"geometry": {
"type": "MultiPoint",
"coordinates": coordinates
}
}
return (
<MapboxGL.MapView style={{flex:1}}>
<MapboxGL.ShapeSource id="asd" shape={geoJSON}>
<MapboxGL.SymbolLayer id="qwe" style={styles.mark}/>
</MapboxGL.ShapeSource>
</MapboxGL.MapView>
)
}
}
const styles = MapboxGL.StyleSheet.create({
mark:{
textField:'·',
textSize:20,
textIgnorePlacement:true,
textOffset:[0,2],
textKeepUpright:true,
textPadding:20,
textColor:'white',
textHaloColor:'black',
textHaloWidth:1,
},
});