aboutsummaryrefslogtreecommitdiff
path: root/app/views/sections/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/sections/show.html.erb')
-rw-r--r--app/views/sections/show.html.erb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/views/sections/show.html.erb b/app/views/sections/show.html.erb
new file mode 100644
index 0000000..9a69891
--- /dev/null
+++ b/app/views/sections/show.html.erb
@@ -0,0 +1,11 @@
+<pre><code lang="ecmascript">
+// First, create a section layer on the map, then assign all resource markers to it.
+sec<%= @section.id %> = L.layerGroup
+
+<% @section.resources.each_with_index do |res, i| %>
+mk_<%= i %> = L.marker([<%= res.latitude %>, <%= res.longitude %>]).addTo(sec<%= @section.id %>)
+<% end %>
+
+sec<%= @section.id %>.addTo(map)
+
+</code></pre>