forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maps added to profile page publiclab#1940 (publiclab#1965)
* Added maps * Created _userLeaflet.html.erb * Maps added * Maps added * Share Location button added * Changed local variable to meaningful name * Static image for sharing location . * Uploaded static image of map * Small change * Static image deleted * Changes done +code indentation done
- Loading branch information
1 parent
796cfa5
commit cbe7e10
Showing
3 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<% if haslocation == true %> | ||
<% unique_id = rand(100) %> | ||
<style> | ||
#map<%= unique_id %> { height:300px; margin: 0; position: relative;} | ||
</style> | ||
<div class="leaflet-map" id="map<%= unique_id %>"></div> | ||
<script> | ||
var map = L.map('map<%= unique_id %>').setView([<%= @map_lat %>,<%= @map_lon %>], 7); | ||
L.tileLayer("//a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png").addTo(map); | ||
<% if !(@map_blurred == "true") %> | ||
L.marker([<%= @map_lat %>, <%= @map_lon %>]).addTo(map).bindPopup("<a href='https://publiclab.org/profile/<%= @profile_user.username %>'><%= @profile_user.username %> </a>"); | ||
<% end %> | ||
</script> | ||
<% else %> | ||
<div id="map_template" style="position: relative; display: inline-block;"> | ||
<img src="https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/0/0/0.png" style="height:300px; margin: 0; position: relative; margin-right: -10px;"> | ||
<button type='button' class='btn btn-default btn-lg' onclick='addLocation()' style="position: absolute; position: absolute;top: 41% ; left: 15% ;"> <strong> Share your Location </strong> </button> | ||
</div> | ||
<script> | ||
function addLocation() { | ||
$('.blurred-location-input').click() ; | ||
} | ||
</script> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters