From 94358a9e8c52ccbcd4fcc9d9525001da2ea6ab23 Mon Sep 17 00:00:00 2001 From: Bernhard Pottler Date: Sun, 30 Jun 2024 15:17:40 +0200 Subject: [PATCH] docs: add short description for using this plugin in e.g. React --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index e31f531..976d1bd 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,23 @@ Source code : Downloads : Demo : + +## Use as ESM module + +To use this plugin in the code of a project (based on e.g. React or Angular) follow these steps: + +1. install leaflet.fullscreen with your package manager (e.g. `npm install leaflet.fullscreen`). + +2. Update your code + +``` +import L from 'leaflet'; +import 'leaflet.fullscreen'; + +const let map = new L.Map('map', { + fullscreenControl: true, + fullscreenControlOptions: { + position: 'topleft' + } +}); +```