From 46ee25fabfc3d2a4493004535774ddea1ad01c91 Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 13 Nov 2020 00:07:11 +0100 Subject: Add leaflet plugin to fix webpack compatibility --- app/javascript/controllers/map_controller.js | 5 +++-- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/controllers/map_controller.js b/app/javascript/controllers/map_controller.js index 5363e5e..2a2b310 100644 --- a/app/javascript/controllers/map_controller.js +++ b/app/javascript/controllers/map_controller.js @@ -7,14 +7,15 @@ // import { Controller } from "stimulus" -import L from "leaflet" import "leaflet/dist/leaflet.css" +import L from "leaflet" + export default class extends Controller { static targets = [ "container" ] initialize() { - console.log("Map controller initialized.") + } connect() { diff --git a/package.json b/package.json index 101fb8b..552cedc 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.3.0", "leaflet": "^1.7.1", + "leaflet-defaulticon-compatibility": "^0.1.1", "stimulus": "^1.1.1", "turbolinks": "^5.2.0" }, diff --git a/yarn.lock b/yarn.lock index a060ead..0f80cb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4160,6 +4160,11 @@ last-call-webpack-plugin@^3.0.0: lodash "^4.17.5" webpack-sources "^1.1.0" +leaflet-defaulticon-compatibility@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/leaflet-defaulticon-compatibility/-/leaflet-defaulticon-compatibility-0.1.1.tgz#ab72257b3da66fb48dab69a10c3824012a15a20a" + integrity sha512-vDBFdlUAwjSEGep9ih8kfJilf6yN8V9zTbF5NC/1ZwLeGko3RUQepspPnGCRMFV51dY3Lb3hziboicrFz+rxQA== + leaflet@^1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.7.1.tgz#10d684916edfe1bf41d688a3b97127c0322a2a19" -- cgit v1.2.3