diff options
| author | Marc Florisson | 2013-05-17 18:55:22 +0200 |
|---|---|---|
| committer | Marc Florisson | 2013-05-17 18:55:22 +0200 |
| commit | f3b470270bcfa7c1a8e0f29ba6dbe95c75605385 (patch) | |
| tree | 4778f65237324cf89f753c5efc624932050b520c /app/maps | |
| parent | 74fa1a9551e1bd6eedabf88a40e5ebc6bed21645 (diff) | |
| download | chouette-core-f3b470270bcfa7c1a8e0f29ba6dbe95c75605385.tar.bz2 | |
add geoportail maps. Refs #21, #122, #127
Diffstat (limited to 'app/maps')
| -rw-r--r-- | app/maps/application_map.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/maps/application_map.rb b/app/maps/application_map.rb index 8e9ce4d57..e068a8950 100644 --- a/app/maps/application_map.rb +++ b/app/maps/application_map.rb @@ -19,6 +19,15 @@ class ApplicationMap self end + def geoportail_key + if ( self.helpers && self.helpers.current_user && + self.helpers.current_user.organisation && + self.helpers.current_user.organisation.geoportail_key) + return self.helpers.current_user.organisation.geoportail_key + end + return nil + end + class Helpers include ActionDispatch::Routing::UrlFor include Rails.application.routes.url_helpers @@ -43,7 +52,7 @@ class ApplicationMap def map @map ||= MapLayers::Map.new(id, :projection => projection("EPSG:900913"), :controls => controls) do |map, page| page << map.add_layer(MapLayers::OSM_MAPNIK) - page << map.add_layer(geoportail_wmts) + page << map.add_layer(geoportail_wmts) if self.geoportail_key page << map.add_layer(google_physical) page << map.add_layer(google_streets) page << map.add_layer(google_hybrid) @@ -70,7 +79,7 @@ class ApplicationMap def geoportail_wmts OpenLayers::Layer::WMTS.new :name => I18n.t("maps.ign_map"), - :url => "http://gpp3-wxs.ign.fr/#{self.class.ign_api_key}/wmts", + :url => "http://gpp3-wxs.ign.fr/#{self.geoportail_key}/wmts", :layer => "GEOGRAPHICALGRIDSYSTEMS.MAPS", :matrixSet => "PM", :style => "normal", |
