react-native-leaflet icon indicating copy to clipboard operation
react-native-leaflet copied to clipboard

Documentation is not clear at all

Open BasselTurky opened this issue 3 years ago • 1 comments

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.

BasselTurky avatar Feb 08 '22 00:02 BasselTurky

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 :

  1. Add mapLayers prop to your LeaftelView and pass an array containing MapLayer structure.
  2. 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;
}
  1. The result have to be something like this :
<LeafletView
mapLayers={[
{ url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' }
]} />

noedelcroix avatar Jun 10 '22 09:06 noedelcroix