From b6aeac4d9274f17e748efb3715aa08f4b7c361f2 Mon Sep 17 00:00:00 2001 From: hellekin Date: Wed, 11 Nov 2020 22:27:18 +0100 Subject: Add map support This commit creates a dedicated Map model and moves the JavaScript from view to a Stimulus controller. - Stimulus.js https://stimulusjs.org - Leaflet.js https://leafletjs.org Upcoming resources: - https://discourse.stimulusjs.org/t/leafletjs-with-stimulusjs-on-rails-6/1343/4 - https://github.com/ghybs/leaflet-defaulticon-compatibility --- app/views/welcome/index.html.erb | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'app/views/welcome') diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 1b6ab77..eac1eff 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -9,7 +9,17 @@

Bienvenue à l'atelier carto d'IN COMMON

-<%= tag.div(id: 'map') %> +<%= map_container %> + +<% content_for :aside do %> +
+
+ +
+ +
+<% end %> <% content_for :debug do %> <% if current_user.present? %> @@ -19,23 +29,3 @@

<%= res.feature["geometry"]["coordinates"] %>

<% end %><%# ensure it does not break when we don't have a record... %> <% end %> - -<% content_for :body_end do %> - -<% end %> -- cgit v1.2.3