Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.33 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.33 KB

Leaflet.Permalink

Adds the maps center and zoom as a permalink for Leaflet maps.

Initially based on the work of MarcChasse.

Features

  • works with Leaflet 1.9.4
  • Should work with all modern browsers
  • also works with asynchronously loaded elements
  • There may be a problem to detect the initial state if you have a slow loading website or an impatient user.

Quick Start

  1. Create a leaflet map. Checkout Leaflets Quick Start Guide for a basic map example.

  2. Download and include leaflet.permalink.min.js

	<script src="../leaflet.permalink.min.js"></script>
  1. Add the following code to the map initialization:
	// create map
	var map = new L.map(...);
	// call this
	map.whenReady ( function() {
		L.Permalink.setup(map);
	});

Complete Example

see here.

Checkout the DEMO.

Another Example

If you are using WordPress and the plugin Leaflet Map there is an example too.