-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (34 loc) · 1.19 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
import React from 'react';
import MapboxGL from '@mapbox/react-native-mapbox-gl';
import indoorMapGeoJSON from '../../json/indoor_3d_map.json';
export default class extends React.Component {
render(){
return (
<MapboxGL.MapView
style={{flex:1}}
centerCoordinate={[-87.618312, 41.866282]}
>
<MapboxGL.ShapeSource
id="indoorBuildingSource"
shape={indoorMapGeoJSON}
>
<MapboxGL.FillExtrusionLayer
id="building3d"
style={layerStyles.building}
>
</MapboxGL.FillExtrusionLayer>
</MapboxGL.ShapeSource>
</MapboxGL.MapView>
)
}
}
const layerStyles = MapboxGL.StyleSheet.create({
light: {},
building: {
fillExtrusionOpacity: 0.5,
fillExtrusionHeight: MapboxGL.StyleSheet.identity('height'),
fillExtrusionBase: MapboxGL.StyleSheet.identity('base_height'),
fillExtrusionColor: MapboxGL.StyleSheet.identity('color'),
fillExtrusionColorTransition: { duration: 2000, delay: 0 },
},
});