- Notifications
You must be signed in to change notification settings - Fork9
Google layer for React-Leaflet using leaflet.gridlayer.googlemutant, implemented with typescript
License
NotificationsYou must be signed in to change notification settings
aviklai/react-leaflet-google-layer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Google layer for React-Leaflet using leaflet.gridlayer.googlemutant, implemented with typescript.
This version of the library supports React Leaflet v2.
- run
npm install --save react-leaflet-google-layer@"^1.x.x" - By default this library uses the google-maps loader library to load the google maps api. If you want to use the script tag instead, you can Add google maps js api in your index.html:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY" async defer></script>
and set the prop useGoogMapsLoader tofalse.
Usage example:
import * as React from 'react';import { Map } from 'react-leaflet';import ReactLeafletGoogleLayer from 'react-leaflet-google-layer';export class App extends React.Component { render() { return ( <Map zoom={15} center={[45, 20]}> <ReactLeafletGoogleLayer googleMapsLoaderConf={{KEY: 'YOUR_API_KEY'}} type={'satellite'} /> </Map> ); }}https://codesandbox.io/s/basicusage-qluec
useGoogMapsLoader?: boolean, default:true
googleMapsAddLayers?: { name: 'BicyclingLayer' | 'TrafficLayer' | 'TransitLayer', options?: any }[]
zIndex?: number
From google-maps (https://github.com/Carrooi/Js-GoogleMapsLoader) - googleMapsLoaderConf prop:
- KEY?: string
- URL?: string
- LIBRARIES?: string[]
- CLIENT?: string
- CHANNEL?: string
- LANGUAGE?: string
- REGION?: string
- VERSION?: string
- WINDOW_CALLBACK_NAME?: string
From googlemutant (https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant):
- minZoom?: number
- maxZoom?: number
- maxNativeZoom?: number
- tileSize?: number | Point
- subdomains?: string | string[]
- errorTileUrl?: string
- attribution?: string
- opacity?: number
- continuousWorld?: boolean
- noWrap?: boolean
- type?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid'
About
Google layer for React-Leaflet using leaflet.gridlayer.googlemutant, implemented with typescript
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.