6
7
8
9
10
11
12
13
14
15
|
# File 'app/osmaps/controllers/main_controller.rb', line 6
def map(latitude, longitude, opts = {})
`var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});`
zoom = opts[:zoom] || 15
`var map = L.map('osmaps').setView([latitude, longitude], 15).addLayer(osm);`
if opts[:title]
`L.marker([ latitude, longitude]).addTo(map).bindPopup(title);`
end
`L.control.scale( {imperial: false} )`
return nil
end
|