.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')
.attr('type', 'hidden')
.appendTo($form);
+ var csrf_param = $("meta[name=csrf-param]").attr("content"),
+ csrf_token = $("meta[name=csrf-token]").attr("content");
+
+ $('<input>')
+ .attr('name', csrf_param)
+ .attr('value', csrf_token)
+ .attr('type', 'hidden')
+ .appendTo($form);
+
$('<p>')
.attr('class', 'deemphasize')
.html(I18n.t('javascripts.share.image_size') + ' <span id="mapnik_image_width"></span> x <span id="mapnik_image_height"></span>')
$('#embed_html').val(
'<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' +
- escapeHTML('http://' + OSM.SERVER_URL + '/export/embed.html?' + $.param(params)) +
+ escapeHTML(OSM.SERVER_PROTOCOL + '://' + OSM.SERVER_URL + '/export/embed.html?' + $.param(params)) +
'" style="border: 1px solid black"></iframe><br/>' +
'<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
$("#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() {