<% content_for :head do %> <%= stylesheet_link_tag("https://unpkg.com/leaflet@1.7.1/dist/leaflet.css", integrity: "sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==", crossorigin: '') %> <%= javascript_include_tag("https://unpkg.com/leaflet@1.7.1/dist/leaflet.js", integrity: "sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==", crossorigin: '') %> <% end %>

Bienvenue à l'atelier carto d'IN COMMON

<%= tag.div(id: 'map') %> <% content_for :debug do %> <%= def test_button list_points = Resource.where('feature @> ?', {"properties": {"categories": [87]}}.to_json) res_list = 0 i = 0 puts list_points return(list_points) end%>

Premier élément de la liste:

<% res = @resources.first %>

<%= res.feature["properties"]["name"] %>

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

<% x = Resource.where('feature @> ?', {"properties": {"categories": [87]}}.to_json)%> <%= x[0].feature %> <%= @number_fiel = number_field_tag("categories")%> <%= "NUMBER FIELD:" + @number_fiel %>

<%= x1 = Resource.where('feature @> ?', {"properties": {"categories": [@number_fiel]}}.to_json) %> <%= "TEST" %> <%= link_to("test_button", "", :onclick=> "update_leaflet(" + "[50.900, 4.351]" + ")", data: "ABC", remote: true)%>

<%= categories = Category.order(:id)%> <%= check_box_tag(categories[0].id, value="1", :onchange=>'alert()') %>

<% categories.each do |category| %> <%= x = check_box_tag("cat_sel", value=category.dewey_id, :onchange=> 'alert()') %> <%= puts x %> <%= label_tag(category.name) %> <% end %> <%= link_to("Update Leaflet", "", :onclick=> "test_button()", remote: true)%> <% end %> <% content_for :body_end do %> <% end %>