]> git.openstreetmap.org Git - rails.git/commitdiff
Only the standard layer can be exported
authorSimon Legner <Simon.Legner@gmail.com>
Mon, 14 Mar 2016 20:42:40 +0000 (21:42 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 14 Mar 2016 21:04:31 +0000 (21:04 +0000)
Fixes #1141
Closes #1182

app/assets/javascripts/leaflet.share.js
config/locales/en.yml

index b991210dfad5a063fcc48d76181c0deb5e72a2c6..a6b10821e868bc603da0b1d4e0bff296cf945818 100644 (file)
@@ -145,7 +145,14 @@ L.OSM.share = function (options) {
       .text(I18n.t('javascripts.share.image'))
       .appendTo($imageSection);
 
+    $('<div>')
+      .attr('id', 'export-warning')
+      .attr('class', 'deemphasize')
+      .text(I18n.t('javascripts.share.only_standard_layer'))
+      .appendTo($imageSection);
+
     $form = $('<form>')
+      .attr('id', 'export-image')
       .attr('class', 'standard-form')
       .attr('action', '/export/finish')
       .attr('method', 'post')
@@ -364,6 +371,14 @@ L.OSM.share = function (options) {
 
       $("#mapnik_image_width").text(Math.round(size.x / scale / 0.00028));
       $("#mapnik_image_height").text(Math.round(size.y / scale / 0.00028));
+
+      if (map.getMapBaseLayerId() === 'mapnik') {
+        $('#export-image').show();
+        $('#export-warning').hide();
+      } else {
+        $('#export-image').hide();
+        $('#export-warning').show();
+      }
     }
 
     function select() {
index 776fae2dae7861496f8b2dc671bc35d2d5e690ec..12cb76b044825c8a0003a6a4809725be3c1b220a 100644 (file)
@@ -2172,6 +2172,7 @@ en:
       center_marker: "Center map on marker"
       paste_html: "Paste HTML to embed in website"
       view_larger_map: "View Larger Map"
+      only_standard_layer: "Only the standard layer can be exported as an image"
     embed:
       report_problem: "Report a problem"
     key: