]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5566'
authorTom Hughes <tom@compton.nu>
Tue, 28 Jan 2025 18:23:33 +0000 (18:23 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 28 Jan 2025 18:23:33 +0000 (18:23 +0000)
1  2 
app/assets/javascripts/index/layers/data.js

index 812c35be94dcf5a412b7a286437e858c64b535fc,5da57d4afb441928c0623aac0a24d6d54ff4b7d9..c10c6ed218d98e71066bc74af2edaaad48be3570
@@@ -44,7 -44,7 +44,7 @@@ OSM.initializeDataLayer = function (map
      }
    }
  
-   function displayFeatureWarning(count, limit, add, cancel) {
+   function displayFeatureWarning(num_features, add, cancel) {
      $("#browse_status").html(
        $("<div class='p-3'>").append(
          $("<div class='d-flex'>").append(
@@@ -55,7 -55,7 +55,7 @@@
                .attr("aria-label", I18n.t("javascripts.close"))
                .click(cancel))),
          $("<p class='alert alert-warning'>")
-           .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })),
+           .text(I18n.t("browse.start_rjs.feature_warning", { num_features })),
          $("<input type='submit' class='btn btn-primary d-block mx-auto'>")
            .val(I18n.t("browse.start_rjs.load_data"))
            .click(add)));
  
      /*
       * Modern browsers are quite happy showing far more than 100 features in
 -     * the data browser, so increase the limit to 4000 by default, but keep
 -     * it restricted to 500 for IE8 and 100 for older IEs.
 +     * the data browser, so increase the limit to 4000 by default.
       */
 -    var maxFeatures = 4000;
 -
 -    /*@cc_on
 -      if (navigator.appVersion < 8) {
 -        maxFeatures = 100;
 -      } else if (navigator.appVersion < 9) {
 -        maxFeatures = 500;
 -      }
 -    @*/
 +    const maxFeatures = 4000;
  
      if (dataLoader) dataLoader.abort();
  
          if (features.length < maxFeatures) {
            addFeatures();
          } else {
-           displayFeatureWarning(features.length, maxFeatures, addFeatures, cancelAddFeatures);
+           displayFeatureWarning(features.length, addFeatures, cancelAddFeatures);
          }
  
          if (map._objectLayer) {