]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/browse/start.js.erb
Don't try and store a user record in the session
[rails.git] / app / views / browse / start.js.erb
index 73ebff85f7529407cf88e23d377d99ee71662c1c..8f04d7a8344a90b9ae95224cc5d66973701fa162 100644 (file)
@@ -35,6 +35,8 @@ function startBrowse() {
   map.events.register("moveend", map, updateData);
   map.events.triggerEvent("moveend");
 
+  $("#browse_select_view").click(useMap);
+
   $("#browse_select_box").click(startDrag);
 
   $("#browse_hide_areas_box").html("<%=j t 'browse.start_rjs.hide_areas' %>");
@@ -133,8 +135,6 @@ function showAreas() {
   useMap(true);
 }
 
-$("#browse_select_view").click(useMap);
-
 function endDrag(bbox) {
   var bounds = bbox.getBounds();
   var projected = bounds.clone().transform(map.getProjectionObject(), epsg4326);
@@ -149,13 +149,13 @@ function endDrag(bbox) {
   $("#browse_select_view").show();
 }
 
-function displayFeatureWarning(count, callback) {
+function displayFeatureWarning(count, limit, callback) {
   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");
@@ -182,7 +182,7 @@ function customDataLoader(resp, options) {
     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);
       });
     }