A leaflet plugin module to display Wikipedia entries on a map layer
http://matthewbarker.github.io/leaflet-wikipedia/
- npm:
npm install leaflet-wikipedia
- Bower:
bower install leaflet-wikipedia
var map = L.map('map').setView([52.4235064, -1.7134741999999998], 14);
// Add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Add a Wikipedia layer
L.layerGroup.wikipediaLayer().addTo(map);
L.layerGroup.wikipediaLayer({ target: '_blank' }).addTo(map);
- The URL for Wikipedia
- type: string
- default: https://en.wikipedia.org/
- The maximum number of search results to return
- type: number
- default: 100
- If true then the popup will open on mouse over; otherwise it won't
- type: Boolean
- default: false
- If true then markers outside the current map bounds will be removed; otherwise they won't
- type: Boolean
- default: false
- Specifies where to open the linked Wikipedia page
- type: string
- default: _self
- Specifies the folder that contains the Wikipedia icon images
- type: string
- default: images/
- Specifies the minimum zoom number
- type: number
- default: 0
- Specifies the maximum zoom number
- type: number
- default: 18