Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include leaflet import only when no here maps provider is configured #34

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading