|
1 |
| -<% content_for :title do %> |
2 |
| - <div class="sidebar-title mt-3"> |
3 |
| - <h3><%= @map.name %></h3> |
4 |
| - </div> |
5 |
| - <div class="map-author"> |
6 |
| - <% if @map.user %> |
7 |
| - by <a href="//publiclab.org/profile/<%= @map.user.login %>"><%= @map.user.login %></a> |
8 |
| - <% else %> |
9 |
| - anonymous |
10 |
| - <% end %> |
11 |
| - </div> |
12 |
| -<% end %> |
13 |
| - |
14 |
| -<% content_for :details do %> |
15 |
| - <div> |
16 |
| - <%=raw markdown_to_html(@map.description) unless @map.description.nil? %> |
17 |
| - </div> |
18 |
| - |
19 |
| - <p> |
20 |
| - <span class="map-detail-label">Location</span> |
21 |
| - <a href="https://www.openstreetmap.org/#map=<%= @map.zoom %>/<%= @map.lat %>/<%= @map.lon %>"><%= @map.location %></a> |
22 |
| - </p> |
23 |
| - |
24 |
| - <table> |
25 |
| - <tr><td><span class="map-detail-label">Latitude </span><%= @map.lat %></td><td><span class="map-detail-label">Longitude </span><%= @map.lon %></td></tr> |
26 |
| - </table> |
| 1 | +<%= stylesheet_link_tag "/lib/leaflet/dist/leaflet.css" %> |
| 2 | +<%= stylesheet_link_tag "https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css" %> |
27 | 3 |
|
28 |
| - <p> |
29 |
| - <span class="map-detail-label">License (<a target="_blank" href="http://publiclab.org/licenses">Learn more</a>):</span> |
30 |
| - <a href="/maps/license/<%= @map.license %>"><%= @map.license %></a> |
31 |
| - </p> |
| 4 | +<%= javascript_include_tag 'maps' %> |
| 5 | +<%= javascript_include_tag '//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js' %> |
| 6 | +<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyAxlBXzYwdeaOMKZgx_UNBp2qBtdD0L_9g" %> |
| 7 | +<%= javascript_include_tag 'https://unpkg.com/leaflet.gridlayer.googlemutant@0.7.0/Leaflet.GoogleMutant.js' %> |
| 8 | +<%= javascript_include_tag '/lib/image-sequencer/dist/image-sequencer.js' %> |
32 | 9 |
|
33 |
| - <hr /> |
34 |
| - <p> |
35 |
| - <% if logged_in? %> |
36 |
| - <button type="button" class="btn btn-outline-info btn-sm" onClick="$('#map-edit-container').toggle()">Edit details</button> |
37 |
| - <% end %> |
38 |
| - <button type="button" class="btn btn-outline-info btn-sm" onClick="$('.share-link').toggle()">Embed code</button> |
39 |
| - <button type="button" class="btn btn-outline-info btn-sm" title="Preview with NDVI" onClick="ImageSequencer().replaceImage('.leaflet-image-layer',['ndvi','colormap'])">NDVI (beta)</button> |
40 |
| - <button type="button" class="btn btn-outline-info btn-sm" rel="tooltip" title="Custom image processing" onClick="ImageSequencer().replaceImage('.leaflet-image-layer',prompt('Enter an ImageSequencer code', 'invert,ndvi,colormap').split(','))">Add ImageSequencer code</button> |
41 |
| - <div class="share-link" style="display:none;"> |
42 |
| - <%= render :partial => 'maps/share' %> |
| 10 | +<div class= "row" id="knitter-map-pane" style="height: 450px; width: 100%; margin-bottom: 1%; z-index: 5; float: none; max-width: none;"> </div> |
| 11 | +<div class="container-fluid"> |
| 12 | + <div class="row"> |
| 13 | + <div class="col-md-6"> |
| 14 | + <button type="button" class="btn btn-outline-info btn-sm" onClick="$('.share-link').toggle()" style="margin-left: 1%;">Embed code</button> |
| 15 | + <div class="share-link" style="display:none;"> |
| 16 | + <%= render :partial => 'maps/share' %> |
| 17 | + </div> |
| 18 | + </div> |
| 19 | + <div class="col-md-6"> |
| 20 | + <a href="/maps/edit/<%= @map.slug %>"> |
| 21 | + <button class="btn btn-outline-info float-right"> |
| 22 | + <span class="fas fa-pencil-alt"> </span> Edit this map |
| 23 | + </button> |
| 24 | + </a> |
| 25 | + </div> |
43 | 26 | </div>
|
44 |
| - <a href="https://publiclab.org/image-sequencer#NDVI">Learn more about ImageSequencer code</a> |
45 |
| - </p> |
| 27 | +</div> |
46 | 28 |
|
47 |
| - <div style="display:none;" id="map-edit-container"> |
48 |
| - <%= render :partial => 'maps/edit' %> |
49 |
| - </div> |
50 |
| - |
51 |
| - <hr /> |
52 |
| - <div class="tags"> |
53 |
| - <%= render :partial => "tags/index" %> |
54 |
| - </div> |
| 29 | +<div class="container-fluid"> |
| 30 | + <div class="text-center lead-text"> |
| 31 | + <p class="text-muted">A Community Atlas of </p> |
| 32 | + <h2><%= @map.location %> </h2> |
| 33 | + <p> by <%= link_to "@#{@map.author}", "/profile/#{@map.author}" unless @map.author == 'anonymous' %> </p> |
| 34 | + </div> |
| 35 | + <br> |
| 36 | +</div> |
55 | 37 |
|
56 |
| - <hr /> |
| 38 | + <div class="container"> |
| 39 | + <div class="card-deck mb-6 text-center mx-auto"> |
| 40 | + <div class="card mapping-kits"> |
| 41 | + <img class="card-img-top img-draw mx-auto" src="<%= asset_path('balloon1.png') %>" alt="balloon icon"> |
| 42 | + <div class="card-body"> |
| 43 | + <h3>Make your own map </h3> |
| 44 | + <p class="card-text item-description"> |
| 45 | + Use a kite, balloon, pole or drone to take an aerial photo and tell your own visual story of the place |
| 46 | + </p> |
| 47 | + <p> |
| 48 | + <a class="btn btn-primary btn-lg" href= 'https://store.publiclab.org/collections/mapping-kits'> |
| 49 | + Get a mapping kit<i class="fa fa-angle-double-right fa-fw" style="font-size:18px;color:white;"></i> |
| 50 | + </a> |
| 51 | + <a class="btn btn-primary btn-lg" href="<%= new_map_url %>"> |
| 52 | + Add a new map <i class="fa fa-plus fa-fw" style="font-size:12px;color:white;"></i> |
| 53 | + </a> |
| 54 | + </p> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + <div class="card mapping-kits"> |
| 58 | + <img class="card-img-top img-draw mx-auto" src="<%= asset_path('quiz.png') %>" alt="questions"> |
| 59 | + <div class="card-body"> |
| 60 | + <h3>Ask a question</h3> |
| 61 | + <p class="card-text item-description"> |
| 62 | + <a href="https://publiclab.org/questions" target="blank">Search </a>through questions or Ask a question to get help from others and share ideas with the PublicLab Community |
| 63 | + <%# hence helping you in your environmental exploration %> |
| 64 | + </p> |
| 65 | + <p> |
| 66 | + <a href="https://publiclab.org/questions/new?tags=lat:<%= @map.lat %>,lon:<%= @map.lon %>&body=Question posted from map at https://mapknitter.org/m/<%= @map.slug %>" target="blank"> |
| 67 | + <button class="btn btn-lg btn-primary"> |
| 68 | + Ask a Question |
| 69 | + </button> |
| 70 | + </a> |
| 71 | + </p> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </div> |
57 | 76 |
|
58 |
| - <div class="comments"> |
59 |
| - <%= render :partial => "comments/index" %> |
60 |
| - <hr /> |
61 |
| - <%= render :partial => "comments/new" %> |
| 77 | + <div class="all-maps light-blue"> |
| 78 | + <br> |
| 79 | + <h3 class="text-center"> Nearby Maps </h3> |
| 80 | + <hr style="max-width: 500px;"> |
| 81 | + <br> |
| 82 | + <%= render :partial => 'front_ui/maps', :locals => { :maps => @maps } %> |
62 | 83 | </div>
|
63 |
| -<% end %> |
64 | 84 |
|
65 |
| -<% content_for :images do %> |
66 |
| - <%= render :partial => "/images/index" %> |
67 |
| -<% end %> |
| 85 | + <script> |
| 86 | + var map |
| 87 | + (function(){ |
| 88 | + window.mapKnitter = new MapKnitter.Map({ |
| 89 | + latlng: L.latLng(<%= @map.lat %>, <%= @map.lon %>), |
| 90 | + zoom: <%= @map.zoom %>, |
| 91 | + readOnly: true, |
| 92 | + logged_in: <%= logged_in? == true %>, |
| 93 | + anonymous: <%= @map.anonymous? == true %>, |
| 94 | + warpablesUrl: "<%= url_for([@map, :warpables])+'.json' unless @map.warpables.empty? %>" |
| 95 | + }); |
| 96 | + <% if @map.warpables.empty? && params[:action] == "show" %> |
| 97 | + $('.modal-welcome').modal() |
| 98 | + <% end %> |
| 99 | + })(); |
| 100 | + </script> |
0 commit comments