New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turtlesocks/react-leaflet.locatecontrol

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turtlesocks/react-leaflet.locatecontrol

React wrapper for the Leaflet Locate Control plugin

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-leaflet.locatecontrol

npm version

Basic React wrapper for the Leaflet Locate Control Plugin

Demo Page

Installation

Add Peer Dependencies:

  // npm
  npm i react-leaflet leaflet.locatecontrol

  // yarn
  yarn add react-leaflet leaflet.locatecontrol

  // pnpm
  pnpm add react-leaflet leaflet.locatecontrol

Add React Leaflet.LocateControl:

  // npm
  npm i @turtlesocks/react-leaflet.locatecontrol

  // yarn
  yarn add @turtlesocks/react-leaflet.locatecontrol

  // pnpm
  pnpm add @turtlesocks/react-leaflet.locatecontrol

Usage

import * as React from 'react'
import { MapContainer, TileLayer } from 'react-leaflet'
import { LocateControl } from '@turtlesocks/react-leaflet.locatecontrol'

import 'leaflet/dist/leaflet.css'
// You still need to import the CSS from the original plugin
import 'leaflet.locatecontrol/dist/L.Control.Locate.min.css'

function App() {
  return (
    <MapContainer center={[40.777455, -73.969036]} zoom={15}>
      <TileLayer
        attribution="Map data © <a href='https://www.openstreetmap.org'>OpenStreetMap</a> contributors"
        url="https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}{r}.png"
      />
      <LocateControl metric position="bottomleft" />
    </MapContainer>
  )
}

Props

Respects all of the properties typed by the original plugin

Contributing

  • pnpm run start to start the Vite dev server with HMR enabled.
  • With VS Code you can open a debugger in Chrome for IDE debugging

Keywords

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc