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');
20 .text(I18n.t('javascripts.share.title'))
23 var $input = $('<input>')
26 map.on('moveend layeradd layerremove', update);
28 options.sidebar.addPane($ui);
33 options.sidebar.togglePane($ui);
37 var center = map.getCenter().wrap();
38 var layers = getMapLayers(map);
39 $input.val(options.getUrl(map));