map.dataLayer.options.code = 'D';
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
+ initializeNotes(map);
if (params.layers.indexOf(map.noteLayer.options.code) >= 0) {
map.addLayer(map.noteLayer);
}
+ initializeBrowse(map);
if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
map.addLayer(map.dataLayer);
}
});
}
- initializeBrowse(map);
- initializeNotes(map);
-
OSM.Index = function(map) {
var page = {};
map.on('layerremove', function (e) {
if (e.layer === dataLayer) {
map.off("moveend", updateData);
+ clearStatus();
}
});
browseBounds = bounds;
getData();
}
- } else {
- setStatus(I18n.t('browse.start_rjs.zoom_or_select'));
}
}
function displayFeatureWarning(count, limit, callback) {
clearStatus();
- var div = document.createElement("div");
-
- var p = document.createElement("p");
- p.appendChild(document.createTextNode(I18n.t("browse.start_rjs.loaded_an_area_with_num_features", { num_features: count, max_features: limit })));
- div.appendChild(p);
-
- var input = document.createElement("input");
- input.type = "submit";
- input.value = I18n.t('browse.start_rjs.load_data');
- input.onclick = callback;
- div.appendChild(input);
-
- $("#browse_content").html("");
- $("#browse_content").append(div);
+ $('#browse_status').append(
+ $("<p class='warning'></p>")
+ .text(I18n.t("browse.start_rjs.loaded_an_area_with_num_features", { num_features: count, max_features: limit }))
+ .append(
+ $("<input type='submit'>")
+ .val(I18n.t('browse.start_rjs.load_data'))
+ .click(callback)));
}
var dataLoader;
dataLoader = $.ajax({
url: url,
success: function (xml) {
- clearStatus();
-
dataLayer.clearLayers();
selectedLayer = null;
var features = dataLayer.buildFeatures(xml);
function addFeatures() {
+ clearStatus();
dataLayer.addData(features);
}
}
function setStatus(status) {
+ $('#browse_status').append($('<p></p>').text(status));
}
function clearStatus() {
+ $('#browse_status').empty();
}
}
manually_select: "Manually select a different area"
hide_areas: "Hide areas"
show_areas: "Show areas"
- loaded_an_area_with_num_features: "You have loaded an area which contains %{num_features} features. In general, some browsers may not cope well with displaying this quantity of data. Generally, browsers work best at displaying less than %{max_features} features at a time: doing anything else may make your browser slow/unresponsive. If you are sure you want to display this data, you may do so by clicking the button below."
+ loaded_an_area_with_num_features: "Loading %{num_features} features, which may make your browser slow or unresponsive. Are sure you want to display this data?"
load_data: "Load Data"
unable_to_load_size: "Unable to load: Bounding box size of %{bbox_size} is too large (must be smaller than %{max_bbox_size})"
loading: "Loading..."