1 L.OSM.share = function (options) {
2 var control = L.control(options);
4 control.onAdd = function (map) {
5 var $container = $('<div>')
6 .attr('class', 'control-share');
9 .attr('class', 'control-button')
11 .attr('title', 'Share')
12 .html('<span class="icon share"></span>')
14 .appendTo($container);
17 .attr('class', 'share-ui')
18 .appendTo(options.uiPane);
21 .text(I18n.t('javascripts.share.title'))
24 var $input = $('<input>')
27 map.on('moveend layeradd layerremove', update);
33 var controlContainer = $('.leaflet-control-container .leaflet-top.leaflet-right');
35 if ($ui.is(':visible')) {
36 $(control.options.uiPane).hide();
37 controlContainer.css({paddingRight: '0'});
39 $(control.options.uiPane).show();
40 controlContainer.css({paddingRight: '200px'});
45 var center = map.getCenter().wrap();
46 var layers = getMapLayers(map);
47 $input.val(options.getUrl(map));