1import * as Maps from 'expo-maps';
2import React, { useContext } from 'react';
3import { StyleSheet, View } from 'react-native';
4
5import ProviderContext from '../context/ProviderContext';
6
7export default function GeoJsonExample() {
8  const provider = useContext(ProviderContext);
9
10  return (
11    <View style={styles.container}>
12      <Maps.ExpoMap style={{ flex: 1, width: '100%' }} provider={provider}>
13        <Maps.GeoJson
14          geoJsonString={JSON.stringify(require('../../../../assets/expo-maps/sample.geo.json'))}
15          defaultStyle={{
16            polygon: {
17              fillColor: 'red',
18              strokeColor: 'yellow',
19              strokeWidth: 5,
20            },
21            marker: {
22              color: 'blue',
23            },
24            polyline: {
25              color: 'magenta',
26              width: 10,
27            },
28          }}
29        />
30      </Maps.ExpoMap>
31    </View>
32  );
33}
34
35const styles = StyleSheet.create({
36  container: {
37    flex: 1,
38  },
39});
40