]> git.openstreetmap.org Git - rails.git/commitdiff
Report the feature limit correctly in the data browser
authorTom Hughes <tom@compton.nu>
Thu, 28 Jun 2012 17:28:34 +0000 (18:28 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 28 Jun 2012 17:28:34 +0000 (18:28 +0100)
app/views/browse/start.js.erb
config/locales/en.yml

index 4426ed7e0743a7d7e4c4b3dcbc423774960bad0e..8f04d7a8344a90b9ae95224cc5d66973701fa162 100644 (file)
@@ -149,13 +149,13 @@ function endDrag(bbox) {
   $("#browse_select_view").show();
 }
 
   $("#browse_select_view").show();
 }
 
-function displayFeatureWarning(count, callback) {
+function displayFeatureWarning(count, limit, callback) {
   clearStatus();
 
   var div = document.createElement("div");
 
   var p = document.createElement("p");
   clearStatus();
 
   var div = document.createElement("div");
 
   var p = document.createElement("p");
-  p.appendChild(document.createTextNode(i18n("<%=j t 'browse.start_rjs.loaded_an_area_with_num_features' %>", { num_features: count })));
+  p.appendChild(document.createTextNode(i18n("<%=j t 'browse.start_rjs.loaded_an_area_with_num_features' %>", { num_features: count, max_features: limit })));
   div.appendChild(p);
 
   var input = document.createElement("input");
   div.appendChild(p);
 
   var input = document.createElement("input");
@@ -182,7 +182,7 @@ function customDataLoader(resp, options) {
     if (!this.maxFeatures || resp.features.length <= this.maxFeatures) {
       options.callback.call(options.scope, resp);
     } else {
     if (!this.maxFeatures || resp.features.length <= this.maxFeatures) {
       options.callback.call(options.scope, resp);
     } else {
-      displayFeatureWarning(resp.features.length, function () {
+      displayFeatureWarning(resp.features.length, this.maxFeatures, function () {
         options.callback.call(options.scope, resp);
       });
     }
         options.callback.call(options.scope, resp);
       });
     }
index 7bfda9593bf5d89f4e8af25ca0a47534511f72f5..ce40b3d8df9eb21a93cb8eea1b63133d198f2408 100644 (file)
@@ -235,7 +235,7 @@ en:
       manually_select: "Manually select a different area"
       hide_areas: "Hide areas"
       show_areas: "Show areas"
       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 100 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: "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."
       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..."
       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..."