Get started with react-leaflet CDN

MIT licensed

React-Leaflet is a popular open-source library for using Leaflet maps in React applications.

Tags:
  • react-component
  • react
  • leaflet
  • map

Stable version

Copied!

How to start using react-leaflet CDN


import React from 'react';
import { MapContainer, TileLayer } from 'react-leaflet';

function Map() {
  return (
    <MapContainer center={[51.505, -0.09]} zoom={13}>
      <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
    </MapContainer>
  );
}

export default Map;

All versions