]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.share.js
Geocode pre-filled values when the user presses 'Go'.
[rails.git] / app / assets / javascripts / leaflet.share.js
index 441acfd7463929ff65bfb9aa4e3753169f96f2af..d4c82953202cb9a4e828a042a10f0efc064bbdee 100644 (file)
@@ -13,7 +13,7 @@ L.OSM.share = function (options) {
     var button = $('<a>')
       .attr('class', 'control-button')
       .attr('href', '#')
-      .attr('title', 'Share')
+      .attr('title', I18n.t('javascripts.share.title'))
       .html('<span class="icon share"></span>')
       .on('click', toggle)
       .appendTo($container);
@@ -25,10 +25,9 @@ L.OSM.share = function (options) {
       .attr('class', 'sidebar_heading')
       .appendTo($ui)
       .append(
-        $('<a>')
+        $('<span>')
           .text(I18n.t('javascripts.close'))
-          .attr('class', 'sidebar_close')
-          .attr('href', '#')
+          .attr('class', 'icon close')
           .bind('click', toggle))
       .append(
         $('<h4>')
@@ -231,6 +230,7 @@ L.OSM.share = function (options) {
 
       update();
       options.sidebar.togglePane($ui, button);
+      $('.leaflet-control .control-button').tooltip('hide');
     }
 
     function toggleMarker() {
@@ -296,14 +296,16 @@ L.OSM.share = function (options) {
       };
 
       if (map.hasLayer(marker)) {
-        params.marker = marker.getLatLng().lat + ',' + marker.getLatLng().lng;
+        var latLng = marker.getLatLng().wrap();
+        params.marker = latLng.lat + ',' + latLng.lng;
       }
 
       $('#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)) +
           '" style="border: 1px solid black"></iframe><br/>' +
-          '<small><a href="' + escapeHTML(map.getUrl(marker)) + '</a></small>');
+          '<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
+          escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
 
       // Image