Credit OpenStreetMap under ODbL.

- broke map attributions into a partial
This commit is contained in:
Miles Gould committed 2013-08-23 14:36:30 +01:00
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"
+2 -1
View File
@@ -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 &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; <a href="http://cloudmade.com">CloudMade</a>',
attribution: '#{ attribution }',
maxZoom: 18
}).addTo(map);
+2 -1
View File
@@ -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 &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; <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