Consolidate layer initialization
This commit is contained in:
parent
35458c0096
commit
de97f7bfe4
3 changed files with 11 additions and 11 deletions
|
@ -93,6 +93,16 @@ $(document).ready(function () {
|
|||
map.dataLayer = new L.OSM.DataLayer(null);
|
||||
map.dataLayer.options.code = 'D';
|
||||
|
||||
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
|
||||
if (params.layers.indexOf(map.noteLayer.options.code) >= 0) {
|
||||
map.addLayer(map.noteLayer);
|
||||
}
|
||||
|
||||
if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
|
||||
map.addLayer(map.dataLayer);
|
||||
}
|
||||
}
|
||||
|
||||
var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright';
|
||||
|
||||
L.OSM.zoom({position: position})
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//= require templates/browse/feature_list
|
||||
//= require templates/browse/feature_history
|
||||
|
||||
function initializeBrowse(map, params) {
|
||||
function initializeBrowse(map) {
|
||||
var browseBounds;
|
||||
var layersById;
|
||||
var selectedLayer;
|
||||
|
@ -49,12 +49,6 @@ function initializeBrowse(map, params) {
|
|||
}
|
||||
});
|
||||
|
||||
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
|
||||
if (params.layers.indexOf(dataLayer.options.code) >= 0) {
|
||||
map.addLayer(dataLayer);
|
||||
}
|
||||
}
|
||||
|
||||
function startBrowse(sidebarHtml) {
|
||||
locationFilter = new L.LocationFilter({
|
||||
enableButton: false,
|
||||
|
|
|
@ -49,10 +49,6 @@ function initializeNotes(map, params) {
|
|||
});
|
||||
|
||||
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
|
||||
if (params.layers.indexOf(noteLayer.options.code) >= 0) {
|
||||
map.addLayer(noteLayer);
|
||||
}
|
||||
|
||||
if (params.note) {
|
||||
$.ajax({
|
||||
url: "/api/" + OSM.API_VERSION + "/notes/" + params.note + ".json",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue