Extract layer configuration to map.js

This commit is contained in:
John Firebaugh 2012-08-30 09:00:55 -07:00 committed by Tom Hughes
parent 5f0c590c32
commit 3b1f455dd9
2 changed files with 6 additions and 8 deletions

View file

@ -71,6 +71,12 @@ function createMap(divName, options) {
});
map.addLayer(markers);
map.dataLayer = new OpenLayers.Layer(I18n.t('browse.start_rjs.data_layer_name'), {
visibility: false,
displayInLayerSwitcher: false
});
map.addLayer(map.dataLayer);
$("#" + divName).on("resized", function () {
map.updateSize();
});

View file

@ -128,14 +128,6 @@ end
function mapInit(){
map = createMap("map");
<% unless STATUS == :api_offline or STATUS == :database_offline %>
map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", {
visibility: false,
displayInLayerSwitcher: false
});
map.addLayer(map.dataLayer);
<% end %>
<% unless object_zoom %>
<% if bbox %>
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);