]> git.openstreetmap.org Git - rails.git/commitdiff
Improve display of alternative download sources
authorRoland Olbricht <roland.olbricht@gmx.de>
Sat, 7 Dec 2013 14:56:47 +0000 (14:56 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 7 Dec 2013 14:56:47 +0000 (14:56 +0000)
Makes the list of alternative sources displayed all the time
rather than just when the bounding box is too large, and adds
the Overpass API to the list of sources.

Fixes #606
Fixed #635

app/assets/javascripts/index/export.js
app/assets/stylesheets/common.css.scss
app/views/site/export.html.erb
config/locales/en.yml

index 053f5169fa9832e622695042b88d18357b204169..fd658c53236922e1125ce55cdc6af2901acd8651 100644 (file)
@@ -41,6 +41,11 @@ OSM.Export = function(map) {
     $("#minlat").val(bounds.getSouth().toFixed(precision));
     $("#maxlon").val(bounds.getEast().toFixed(precision));
     $("#maxlat").val(bounds.getNorth().toFixed(precision));
     $("#minlat").val(bounds.getSouth().toFixed(precision));
     $("#maxlon").val(bounds.getEast().toFixed(precision));
     $("#maxlat").val(bounds.getNorth().toFixed(precision));
+
+    $("#export_overpass").attr("href",
+        "http://overpass-api.de/api/map?bbox=" +
+        $("#minlon").val() + "," + $("#minlat").val() + "," +
+        $("#maxlon").val() + "," + $("#maxlat").val());
   }
 
   function validateControls() {
   }
 
   function validateControls() {
index 75c9213362783a2bb81956b310a0b720db48d1ba..fa61360897e6a7723287ff28c81c1e83b275c51f 100644 (file)
@@ -1160,6 +1160,7 @@ header .search_form {
 
   .export_button {
     margin-top: $lineheight;
 
   .export_button {
     margin-top: $lineheight;
+    margin-bottom: $lineheight;
   }
 
   dl {
   }
 
   dl {
index 176507207030bae77284cc61049e97d5111d8091..78b98ae08f10f78e13badb487d4ae7e13c26742b 100644 (file)
     <p class="warning">
       <%= t'export.start.too_large.body' %>
     </p>
     <p class="warning">
       <%= t'export.start.too_large.body' %>
     </p>
-    <dl class="inner12">
-      <dt><a href="http://planet.openstreetmap.org/"><%= t'export.start.too_large.planet.title' %></a></dt>
-      <dd><%= t'export.start.too_large.planet.description' %></dd>
-
-      <dt><a href="http://download.geofabrik.de/"><%= t'export.start.too_large.geofabrik.title' %></a></dt>
-      <dd><%= t'export.start.too_large.geofabrik.description' %></dd>
+  </div>
 
 
-      <dt><a href="http://metro.teczno.com/"><%= t'export.start.too_large.metro.title' %></a></dt>
-      <dd><%= t'export.start.too_large.metro.description' %></dd>
+  <div id="export_commit">
+    <div class="export_button">
+      <%= submit_tag t('export.start.export_button') %>
+    </div>
 
 
-      <dt><a href="http://wiki.openstreetmap.org/wiki/Download"><%= t'export.start.too_large.other.title' %></a></dt>
-      <dd><%= t'export.start.too_large.other.description' %></dd>
-    </dl>
+    <p><%= t'export.start.too_large.advice' %></p>
   </div>
 
   </div>
 
-  <div class="export_button">
-    <%= submit_tag t('export.start.export_button'), :id => "export_commit" %>
-  </div>
+  <dl class="inner12">  
+    <dt><a id="export_overpass" href="http://overpass-api.de/api/map?bbox="><%= t'export.start.too_large.overpass.title' %></a></dt>
+    <dd><%= t'export.start.too_large.overpass.description' %></dd>
+    
+    <dt><a href="http://planet.openstreetmap.org/"><%= t'export.start.too_large.planet.title' %></a></dt>
+    <dd><%= t'export.start.too_large.planet.description' %></dd>
+
+    <dt><a href="http://download.geofabrik.de/"><%= t'export.start.too_large.geofabrik.title' %></a></dt>
+    <dd><%= t'export.start.too_large.geofabrik.description' %></dd>
+
+    <dt><a href="http://metro.teczno.com/"><%= t'export.start.too_large.metro.title' %></a></dt>
+    <dd><%= t'export.start.too_large.metro.description' %></dd>
+
+    <dt><a href="http://wiki.openstreetmap.org/wiki/Download"><%= t'export.start.too_large.other.title' %></a></dt>
+    <dd><%= t'export.start.too_large.other.description' %></dd>
+  </dl>
 <% end %>
 <% end %>
index 53d5d541b4e0f6b977914099b3d5a180b049a907..46f88d19b0e64f51e73f74ff46bae08edf1d2803 100644 (file)
@@ -310,10 +310,14 @@ en:
       licence: "Licence"
       export_details: 'OpenStreetMap data is licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Data Commons Open Database License</a> (ODbL).'
       too_large:
       licence: "Licence"
       export_details: 'OpenStreetMap data is licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Data Commons Open Database License</a> (ODbL).'
       too_large:
+        advice: "If the above export fails, please consider using one of the sources listed below:"
         body: "This area is too large to be exported as OpenStreetMap XML Data. Please zoom in or select a smaller area, or use one of the sources listed below for bulk data downloads."
         planet:
           title: "Planet OSM"
           description: "Regularly-updated copies of the complete OpenStreetMap database"
         body: "This area is too large to be exported as OpenStreetMap XML Data. Please zoom in or select a smaller area, or use one of the sources listed below for bulk data downloads."
         planet:
           title: "Planet OSM"
           description: "Regularly-updated copies of the complete OpenStreetMap database"
+        overpass:
+          title: "Overpass API"
+          description: "Download this bounding box from a mirror of the OpenStreetMap database"
         geofabrik:
           title: "Geofabrik Downloads"
           description: "Regularly-updated extracts of continents, countries, and selected cities"
         geofabrik:
           title: "Geofabrik Downloads"
           description: "Regularly-updated extracts of continents, countries, and selected cities"