From 52126dc3c1ff197d2e73b7876768c0c0677ff94d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 2 Oct 2009 23:03:42 +0000 Subject: [PATCH] There is no need to translate the names of layers which are not shown in the layer switcher. --- app/views/layouts/site.html.erb | 3 --- config/locales/en.yml | 3 --- public/javascripts/map.js | 8 ++++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index a1d835dc1..46a3d9d11 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -12,9 +12,6 @@ rails_i18n["site.layers.base.cycle_map"] = '<%= escape_javascript(t('site.layers.base.cycle_map')) %>'; rails_i18n["site.layers.base.noname"] = '<%= escape_javascript(t('site.layers.base.noname')) %>'; rails_i18n["site.layers.overlays.maplint"] = '<%= escape_javascript(t('site.layers.overlays.maplint')) %>'; - rails_i18n["site.layers.overlays.markers"] = '<%= escape_javascript(t('site.layers.overlays.markers')) %>'; - rails_i18n["site.layers.overlays.objects"] = '<%= escape_javascript(t('site.layers.overlays.objects')) %>'; - rails_i18n["site.layers.overlays.box_layer"] = '<%= escape_javascript(t('site.layers.overlays.box_layer')) %>'; <%= javascript_include_tag 'prototype' %> <%= javascript_include_tag 'site' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 0473e7713..fb433d8af 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -622,9 +622,6 @@ en: noname: NoName overlays: maplint: Maplint - markers: Markers - objects: Objects - box_layer: Box Layer index: js_1: "You are either using a browser that doesn't support JavaScript, or you have disabled JavaScript." js_2: "OpenStreetMap uses JavaScript for its slippy map." diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 2685fc03a..1afd3eef9 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -74,7 +74,7 @@ function createMap(divName, options) { var numZoomLevels = Math.max(mapnik.numZoomLevels, osmarender.numZoomLevels); - markers = new OpenLayers.Layer.Markers(rails_i18n["site.layers.overlays.markers"], { + markers = new OpenLayers.Layer.Markers("Markers", { displayInLayerSwitcher: false, numZoomLevels: numZoomLevels, maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508), @@ -108,7 +108,7 @@ function addMarkerToMap(position, icon, description) { } function addObjectToMap(url, zoom, callback) { - var layer = new OpenLayers.Layer.GML(rails_i18n["site.layers.overlays.objects"], url, { + var layer = new OpenLayers.Layer.GML("Objects", url, { format: OpenLayers.Format.OSM, style: { strokeColor: "blue", @@ -152,9 +152,9 @@ function addObjectToMap(url, zoom, callback) { } function addBoxToMap(boxbounds) { - if(!vectors) { + if (!vectors) { // Be aware that IE requires Vector layers be initialised on page load, and not under deferred script conditions - vectors = new OpenLayers.Layer.Vector(rails_i18n["site.layers.overlays.box_layer"], { + vectors = new OpenLayers.Layer.Vector("Boxes", { displayInLayerSwitcher: false }); map.addLayer(vectors); -- 2.39.5