New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-leaflet-jsx

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-leaflet-jsx

`react-leaflet-jsx` is a lightweight NPM package that allows you to render arbitrary JSX content directly onto a React Leaflet map. Easily place any React component or HTML element at specific coordinates on the map!

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

react-leaflet-jsx

react-leaflet-jsx is a lightweight NPM package that allows you to render arbitrary JSX content directly onto a React Leaflet map. Easily place any React component or HTML element at specific coordinates on the map!

Demo

Check out the interactive demo: https://evertdespiegeleer.github.io/react-leaflet-jsx/

Installation

Install the package using npm or yarn:

npm install react-leaflet-jsx

Usage

react-leaflet-jsx integrates smoothly within a MapContainer. Use the JSXMapContent component and pass a position to place any JSX content at that point on the map.

import { MapContainer } from 'react-leaflet';
import { JSXMapContent } from 'react-leaflet-jsx';

const position = {{ lat: 50, lng: 3 }}

function MyMap() {
  return (
    <MapContainer center={position} zoom={13} style={{ height: '100vh' }}>
      <JSXMapContent position={position}>
        <div>
          This div is placed at the specified position on the map, you can put whatever here!
        </div>
      </JSXMapContent>
    </MapContainer>
  );
}

Happy mapping! 🌎

FAQs

Package last updated on 30 Aug 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