mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-25 16:28:24 -04:00
Credit OpenStreetMap under ODbL.
- broke map attributions into a partial
This commit is contained in:
1 parent
8ce2798fb3
commit
60ddc82d9f
4 files changed
+31
-2
No files matched your search
@@ -0,0 +1,6 @@
|
||||
Map data ©
|
||||
= link_to "OpenStreetMap", "http://openstreetmap.org"
|
||||
contributors under
|
||||
= link_to "ODbL", "http://www.openstreetmap.org/copyright"
|
||||
| Imagery ©
|
||||
= link_to "CloudMade", "http://cloudmade.com"
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
<script src="/assets/leaflet.js?body=1" type="text/javascript"></script>
|
||||
|
||||
- attribution = render(:partial => 'map_attribution').gsub(/\n/, " ")
|
||||
:javascript
|
||||
map = L.map('map').setView([0.0, -0.0], 2);
|
||||
L.tileLayer("http://{s}.tile.cloudmade.com/#{ ENV['CLOUDMADE_KEY'] }/997/256/{z}/{x}/{y}.png", {
|
||||
attribution: 'Map data © <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://cloudmade.com">CloudMade</a>',
|
||||
attribution: '#{ attribution }',
|
||||
maxZoom: 18
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
%div#map{ :style => "height:300px"}
|
||||
|
||||
- attribution = render(:partial => 'map_attribution').gsub(/\n/, " ")
|
||||
:javascript
|
||||
map = L.map('map').setView([#{ @latitude }, #{ @longitude }]).fitBounds([ [#{@sw_lat}, #{@sw_lng}], [#{@ne_lat}, #{@ne_lng}] ]);
|
||||
L.tileLayer("http://{s}.tile.cloudmade.com/#{ ENV['CLOUDMADE_KEY'] }/997/256/{z}/{x}/{y}.png", {
|
||||
attribution: 'Map data © <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://cloudmade.com">CloudMade</a>',
|
||||
attribution: '#{ attribution }',
|
||||
maxZoom: 18
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "places/_map_attribution.html.haml", :type => :view do
|
||||
before(:each) do
|
||||
render
|
||||
end
|
||||
|
||||
it "links to OpenStreetMap" do
|
||||
assert_select "a", :href => "http://openstreetmap.org",
|
||||
:text => "OpenStreetMap"
|
||||
end
|
||||
|
||||
it "links to the ODbL" do
|
||||
assert_select "a", :href => "http://www.openstreetmap.org/copyright",
|
||||
:text => "ODbL"
|
||||
end
|
||||
|
||||
it "links to CloudMade" do
|
||||
assert_select "a", :href => "http://cloudmade.com", :text => "CloudMade"
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user