Skip to content

Commit d857f0d

Browse files
committed
Bundle default leaflet marker images
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
1 parent 0bb3e26 commit d857f0d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

public/js/extra.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,12 @@ export function finishView (view) {
476476
attribution: '<a href="https://www.openstreetmap.org/">OSM</a>',
477477
maxZoom: 18,
478478
}).addTo(map)
479-
L.marker(position).addTo(map)
479+
L.marker(position, {
480+
icon: L.icon({
481+
iconUrl: `${serverurl}/build/leaflet/images/marker-icon.png`,
482+
shadowUrl: `${serverurl}/build/leaflet/images/marker-shadow.png`
483+
})
484+
}).addTo(map)
480485
$elem.addClass('geo')
481486
} catch (err) {
482487
$elem.append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)

webpack.common.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ module.exports = {
181181
from: '*',
182182
to: 'dictionary-de-ch/'
183183
},
184+
{
185+
context: path.join(__dirname, 'node_modules/leaflet'),
186+
from: 'dist',
187+
to: 'leaflet'
188+
}
184189
]),
185190
new MiniCssExtractPlugin()
186191
],

0 commit comments

Comments
 (0)