round numbers
authorChristopher Schmidt <crschmidt@crschmidt.net>
Tue, 29 Apr 2008 14:41:59 +0000 (14:41 +0000)
committerChristopher Schmidt <crschmidt@crschmidt.net>
Tue, 29 Apr 2008 14:41:59 +0000 (14:41 +0000)
app/views/export/start.rjs

index b53d4ed..52fd61e 100644 (file)
@@ -166,12 +166,15 @@ page << <<EOJ
        var zoom = map.getZoomForExtent(projBounds);
        var center = bounds.getCenterLonLat();
        var marker = $("html_marker").checked;
-       var url = 'http://crschmidt2.dev.openstreetmap.org/export/embed.html?lat='+center.lat+'&lon='+center.lon+'&zoom='+zoom;
+       var url = 'http://crschmidt2.dev.openstreetmap.org/export/embed.html?lat='+center.lat.toFixed(5)+'&lon='+center.lon.toFixed(5)+'&zoom='+zoom;
        if (marker) {
            url += "&marker=true";
        }    
        var html = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'"></iframe>';
        $("export_html_text").value = html;
+       if ($("format_html").checked) {
+           $("export_html_text").select();
+       }
   }
   $("html_marker").onclick = htmlBoundsChanged;
 
@@ -201,6 +204,7 @@ page << <<EOJ
     if ($("format_html").checked) { 
       $("export_html").style.display = "inline";
       $("export_commit").style.display = "none";
+      $("export_html_text").select();
     } else {
       $("export_html").style.display = "none";
     }