Add clearer close action, refactor base layer code
This commit is contained in:
parent
c26b60c4c6
commit
ded28617c7
6 changed files with 35 additions and 7 deletions
|
@ -126,13 +126,14 @@ function getShortUrl(map) {
|
|||
|
||||
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()
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ function initializeExport(map) {
|
|||
|
||||
openSidebar();
|
||||
|
||||
if (getMapBaseLayerId(map) == "mapnik") {
|
||||
if (map.getMapBaseLayerId() == "mapnik") {
|
||||
$("#format_mapnik").prop("checked", true);
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ function initializeExport(map) {
|
|||
|
||||
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 = "";
|
||||
|
|
|
@ -18,6 +18,12 @@ L.OSM.key = function (options) {
|
|||
|
||||
$('<section>')
|
||||
.appendTo($ui)
|
||||
.append(
|
||||
$('<a>')
|
||||
.html('»')
|
||||
.attr('class', 'close-button')
|
||||
.attr('href', '#')
|
||||
.bind('click', toggle))
|
||||
.append(
|
||||
$('<h2>')
|
||||
.text(I18n.t('javascripts.key.title')));
|
||||
|
@ -47,7 +53,7 @@ L.OSM.key = function (options) {
|
|||
}
|
||||
|
||||
function update() {
|
||||
var layer = getMapBaseLayerId(map),
|
||||
var layer = map.getMapBaseLayerId(),
|
||||
zoom = map.getZoom();
|
||||
|
||||
$('.mapkey-table-entry').each(function () {
|
||||
|
|
|
@ -20,6 +20,12 @@ L.OSM.layers = function(options) {
|
|||
|
||||
$('<section>')
|
||||
.appendTo($ui)
|
||||
.append(
|
||||
$('<a>')
|
||||
.html('»')
|
||||
.attr('class', 'close-button')
|
||||
.attr('href', '#')
|
||||
.bind('click', toggle))
|
||||
.append(
|
||||
$('<h2>')
|
||||
.text(I18n.t('javascripts.map.layers.header')));
|
||||
|
|
|
@ -18,6 +18,12 @@ L.OSM.share = function (options) {
|
|||
|
||||
$('<section>')
|
||||
.appendTo($ui)
|
||||
.append(
|
||||
$('<a>')
|
||||
.html('»')
|
||||
.attr('class', 'close-button')
|
||||
.attr('href', '#')
|
||||
.bind('click', toggle))
|
||||
.append(
|
||||
$('<h2>')
|
||||
.text(I18n.t('javascripts.share.title')));
|
||||
|
|
|
@ -604,6 +604,15 @@ a.donate {
|
|||
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;
|
||||
|
@ -1268,7 +1277,7 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
|
|||
}
|
||||
h1, h2 {
|
||||
font-size: 21px;
|
||||
line-height: 1;
|
||||
line-height: 1em;
|
||||
}
|
||||
small.deemphasize {
|
||||
float: left;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue