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 b991210..a6b1082 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 776fae2..12cb76b 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: