Bundle default leaflet marker images

Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
Yukai Huang 2019-09-28 19:24:55 +08:00
parent 0bb3e2614b
commit d857f0d12f
No known key found for this signature in database
GPG Key ID: D4D3B2F0E99D4914
2 changed files with 11 additions and 1 deletions

View File

@ -476,7 +476,12 @@ export function finishView (view) {
attribution: '<a href="https://www.openstreetmap.org/">OSM</a>',
maxZoom: 18,
}).addTo(map)
L.marker(position).addTo(map)
L.marker(position, {
icon: L.icon({
iconUrl: `${serverurl}/build/leaflet/images/marker-icon.png`,
shadowUrl: `${serverurl}/build/leaflet/images/marker-shadow.png`
})
}).addTo(map)
$elem.addClass('geo')
} catch (err) {
$elem.append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)

View File

@ -181,6 +181,11 @@ module.exports = {
from: '*',
to: 'dictionary-de-ch/'
},
{
context: path.join(__dirname, 'node_modules/leaflet'),
from: 'dist',
to: 'leaflet'
}
]),
new MiniCssExtractPlugin()
],