This plugin is a fork of https://wordpress.org/plugins/leaflet-map/
Leaflet Map WordPress Plugin
Upload the entire
r23-mapfolder to the
Activate the plugin through the 'Plugins' menu in WordPress.
You will find 'Leaflet Map' menu in your WordPress admin panel.
Height, width, latitude, longitude and zoom are the basic attributes:
[leaflet-map height=250 width=250 lat=44.67 lng=-63.61 zoom=5]
However, you can also just give it an address, and Google will look it up for you:
[leaflet-map address="Oslo, Norway"]
[leaflet-map attribution="Copyright @bozdoz"]
The zoom buttons can be large and annoying. Enable or disable per map in shortcode:
Alternatively, you could use a plain image for visitors to zoom and pan around with
Add a marker to any map by adding
[leaflet-marker] after any
[leaflet-map] shortcode. You can adjust the lat/lng in the same way, as well as some other basic functionality (popup message, draggable, visible on load). Also, if you want to add a link to a marker popup, use
[leaflet-marker]Message here: click here[/leaflet-marker] and add a link like you normally would with the WordPress editor.
Add a line to the map by adding
[leaflet-line]. You can specify the postions with a list separated by semi-colon
; or bar
| using lat/lng:
[leaflet-line latlngs="41, 29; 44, 18"] or addresses:
[leaflet-line addresses="Istanbul; Sarajevo"], or x/y coordinates for image maps.
Or you can add a geojson shape via a url:
Check it out here.
Same idea as geojson (above), but takes KML files and loads Mapbox's togeojson library