Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

 
 

Repository files navigation

Build StatusCoverage Statusnpm version

Google layer for React-Leaflet using leaflet.gridlayer.googlemutant, implemented with typescript.

Requirements

This version of the library supports React Leaflet v2.

Installation instructions:

  1. runnpm install --save react-leaflet-google-layer@"^1.x.x"
  2. 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>    );  }}

Basic usage example

https://codesandbox.io/s/basicusage-qluec

Options

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
  • 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

Stars

Watchers

Forks

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp