import Mapa from 'react-native-mapa';
// or import { MapView, Camera } from 'react-native-mapa';
<Mapa.MapView>
<Mapa.GeoJSONSource id="geojson-id" url={geojson}>
...
</Mapa.GeoJSONSource>
</Mapa.MapView>GeoJSONSource
Props
id
id:
string
Source identifier
existing?
optionalexisting:boolean
Whether the source exists
url
url:
string|GeoJSON.GeometryCollection|GeoJSON.Feature|GeoJSON.FeatureCollection|GeoJSON.Geometry
HTTP(S) URL, file path, or GeoJSON format object
tileMaxZoom
optionaltileMaxZoom:number
Maximum zoom level for generating vector tiles. The map will automatically generate tiles based on the maximum zoom level to improve rendering performance
buffer
optionalbuffer:number
Sets the buffer value for each edge of the tile. 0 means no buffer, 512 means the buffer is the same size as the tile. When set to a larger value, rendering performance will decrease
hitbox
optionalhitbox: [number,number]
Sets the buffer range for press events
onPress()
optionalonPress: (e) =>void
Parameters
• e: OnPressEvent
Returns
void
children
children:
ReactElement|ReactElement[]