From d857f0d12f5080f1530d918b59a6d1b181cef413 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Sat, 28 Sep 2019 19:24:55 +0800 Subject: [PATCH] Bundle default leaflet marker images Signed-off-by: Yukai Huang --- public/js/extra.js | 7 ++++++- webpack.common.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/public/js/extra.js b/public/js/extra.js index bbae1468..0c39f31b 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -476,7 +476,12 @@ export function finishView (view) { attribution: 'OSM', 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(`
${escapeHTML(err)}
`) diff --git a/webpack.common.js b/webpack.common.js index c26f6b80..6347fdb8 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -181,6 +181,11 @@ module.exports = { from: '*', to: 'dictionary-de-ch/' }, + { + context: path.join(__dirname, 'node_modules/leaflet'), + from: 'dist', + to: 'leaflet' + } ]), new MiniCssExtractPlugin() ],