James Mason 2017-10-10 10:25:49 -07:00
parent 9b5a6ddb5c
commit c48f458a80
No known key found for this signature in database
GPG key ID: 1B3951886C449023

View file

@ -3,14 +3,14 @@
- content_for(:script_body) do - content_for(:script_body) do
:javascript :javascript
// create a map in the "map" div, set the view to a given place and zoom // create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map', { scrollWheelZoom: false }).setView([#{@conference.venue.latitude}, #{@conference.venue.longitude}], 11); var map = L.map('map', { scrollWheelZoom: false }).setView([#{sanitize @conference.venue.latitude}, #{sanitize @conference.venue.longitude}], 11);
// add an OpenStreetMap tile layer // add an OpenStreetMap tile layer
L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18 maxZoom: 18
}).addTo(map); }).addTo(map);
// add a marker in the given location, attach some popup content to it and open the popup // add a marker in the given location, attach some popup content to it and open the popup
L.marker([#{@conference.venue.latitude}, #{@conference.venue.longitude}]).addTo(map) L.marker([#{sanitize @conference.venue.latitude}, #{sanitize @conference.venue.longitude}]).addTo(map)
.bindPopup("#{popup}") .bindPopup("#{popup}")
.openPopup(); .openPopup();
// Turn scrollwheel on when user clicks // Turn scrollwheel on when user clicks