function getUrl(map) {
var center = map.getCenter(),
- zoom = map.getZoom();
+ zoom = map.getZoom(),
+ toZoom = zoomPrecision(zoom);
return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
'http://openstreetmap.org/?' : '/?') +
querystring.stringify({
- lat: center.lat,
- lon: center.lng,
+ lat: toZoom(center.lat),
+ lon: toZoom(center.lng),
zoom: zoom,
layers: map.getLayersCode()
});
openSidebar();
- if (getMapBaseLayerId(map) == "mapnik") {
+ if (map.getMapBaseLayerId() == "mapnik") {
$("#format_mapnik").prop("checked", true);
}
function htmlUrlChanged() {
var bounds = getBounds();
- var layerName = getMapBaseLayerId(map);
+ var layerName = map.getMapBaseLayerId();
var url = "http://" + OSM.SERVER_URL + "/export/embed.html?bbox=" + bounds.toBBoxString() + "&layer=" + layerName;
var markerUrl = "";
$('<section>')
.appendTo($ui)
+ .append(
+ $('<a>')
+ .html('»')
+ .attr('class', 'close-button')
+ .attr('href', '#')
+ .bind('click', toggle))
.append(
$('<h2>')
.text(I18n.t('javascripts.key.title')));
}
function update() {
- var layer = getMapBaseLayerId(map),
+ var layer = map.getMapBaseLayerId(),
zoom = map.getZoom();
$('.mapkey-table-entry').each(function () {
$('<section>')
.appendTo($ui)
+ .append(
+ $('<a>')
+ .html('»')
+ .attr('class', 'close-button')
+ .attr('href', '#')
+ .bind('click', toggle))
.append(
$('<h2>')
.text(I18n.t('javascripts.map.layers.header')));
$('<section>')
.appendTo($ui)
+ .append(
+ $('<a>')
+ .html('»')
+ .attr('class', 'close-button')
+ .attr('href', '#')
+ .bind('click', toggle))
.append(
$('<h2>')
.text(I18n.t('javascripts.share.title')));
margin:0;
}
+ a.close-button {
+ float: right;
+ padding:5px;
+ font-size:20px;
+ line-height:15px;
+ color:#222;
+ border:1px solid #ddd;
+ }
+
li {
border-radius: 4px;
overflow: hidden;
}
h1, h2 {
font-size: 21px;
- line-height: 1;
+ line-height: 1em;
}
small.deemphasize {
float: left;