react-native-leaflet
react-native-leaflet copied to clipboard
Documentation is not clear at all
Are there built-in layers in this library? I want to use satellite tiles in my app. Also, I can't find any examples of how to use map Props.
Hello,
I'm not the maintainer of this project but you can check the src/LeafletView/types.ts file. There is the definition of each type used by this project.
For your issue :
- Add mapLayers prop to your LeaftelView and pass an array containing MapLayer structure.
- In types.ts file, MapLayer structure is like this :
export interface MapLayer {
attribution?: string;
baseLayer?: boolean;
baseLayerIsChecked?: boolean;
baseLayerName?: string;
bounds?: LatLngBounds;
id?: string;
layerType?: MapLayerType;
opacity?: number;
pane?: string;
subLayer?: string;
url?: string;
zIndex?: number;
}
- The result have to be something like this :
<LeafletView
mapLayers={[
{ url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' }
]} />