Skip to content

Commit

Permalink
Include leaflet import only when no here maps provider is configured (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi authored Oct 2, 2023
1 parent 42479d2 commit 13cb664
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
</section>

<%= render partial: "template" %>
<% unless %w[here].include?(Decidim.config.maps&.fetch(:provider)) %>
<%= javascript_pack_tag "decidim_leaflet" %>
<% end %>
<%= javascript_pack_tag "decidim_navigation_maps" %>
1 change: 1 addition & 0 deletions app/packs/entrypoints/decidim_leaflet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "leaflet"
1 change: 0 additions & 1 deletion app/packs/src/decidim/navigation_maps/map_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Creates a map view
import "leaflet";
import "leaflet/dist/leaflet.css";
import "@geoman-io/leaflet-geoman-free";
import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
Expand Down
1 change: 1 addition & 0 deletions config/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# SCSS files within the entrypoints, they become available for inclusion using
# `stylesheet_pack_tag`.
Decidim::Webpacker.register_entrypoints(
decidim_leaflet: "#{base_path}/app/packs/entrypoints/decidim_leaflet.js",
decidim_navigation_maps: "#{base_path}/app/packs/entrypoints/decidim_navigation_maps.js",
decidim_admin_navigation_maps: "#{base_path}/app/packs/entrypoints/decidim_admin_navigation_maps.js"
)
Expand Down

0 comments on commit 13cb664

Please sign in to comment.