parent
4676179879
commit
6403cb9b08
4 changed files with 41 additions and 1 deletions
|
@ -170,6 +170,24 @@ L.OSM.Map = L.Map.extend({
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getGeoUri: function(marker) {
|
||||||
|
var precision = OSM.zoomPrecision(this.getZoom()),
|
||||||
|
latLng,
|
||||||
|
params = {};
|
||||||
|
|
||||||
|
if (marker && this.hasLayer(marker)) {
|
||||||
|
latLng = marker.getLatLng().wrap();
|
||||||
|
} else {
|
||||||
|
latLng = this.getCenter();
|
||||||
|
}
|
||||||
|
|
||||||
|
params.lat = latLng.lat.toFixed(precision);
|
||||||
|
params.lon = latLng.lng.toFixed(precision);
|
||||||
|
params.zoom = this.getZoom();
|
||||||
|
|
||||||
|
return 'geo:' + params.lat + ',' + params.lon + '?z=' + params.zoom;
|
||||||
|
},
|
||||||
|
|
||||||
addObject: function(object, callback) {
|
addObject: function(object, callback) {
|
||||||
var objectStyle = {
|
var objectStyle = {
|
||||||
color: "#FF6200",
|
color: "#FF6200",
|
||||||
|
|
|
@ -120,6 +120,21 @@ L.OSM.share = function (options) {
|
||||||
.text(I18n.t('javascripts.share.paste_html'))
|
.text(I18n.t('javascripts.share.paste_html'))
|
||||||
.appendTo($linkSection));
|
.appendTo($linkSection));
|
||||||
|
|
||||||
|
// Geo URI
|
||||||
|
|
||||||
|
var $geoUriSection = $('<div>')
|
||||||
|
.attr('class', 'section share-geo-uri')
|
||||||
|
.appendTo($ui);
|
||||||
|
|
||||||
|
$('<h4>')
|
||||||
|
.text(I18n.t('javascripts.share.geo_uri'))
|
||||||
|
.appendTo($geoUriSection);
|
||||||
|
|
||||||
|
$('<div>')
|
||||||
|
.appendTo($geoUriSection)
|
||||||
|
.append($('<a>')
|
||||||
|
.attr('id', 'geo_uri'));
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
|
|
||||||
var $imageSection = $('<div>')
|
var $imageSection = $('<div>')
|
||||||
|
@ -320,6 +335,12 @@ L.OSM.share = function (options) {
|
||||||
'<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
|
'<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
|
||||||
escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
|
escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
|
||||||
|
|
||||||
|
// Geo URI
|
||||||
|
|
||||||
|
$('#geo_uri')
|
||||||
|
.attr('href', map.getGeoUri(marker))
|
||||||
|
.html(map.getGeoUri(marker));
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
|
|
||||||
if (locationFilter.isEnabled()) {
|
if (locationFilter.isEnabled()) {
|
||||||
|
|
|
@ -721,6 +721,7 @@ nav.secondary {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: $lightblue;
|
background-color: $lightblue;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
|
border-right: 1px solid #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:first-child {
|
a:first-child {
|
||||||
|
@ -729,7 +730,6 @@ nav.secondary {
|
||||||
}
|
}
|
||||||
|
|
||||||
a:last-child {
|
a:last-child {
|
||||||
border-left: 1px solid #fff;
|
|
||||||
border-radius: 0 4px 4px 0;
|
border-radius: 0 4px 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2163,6 +2163,7 @@ en:
|
||||||
link: "Link or HTML"
|
link: "Link or HTML"
|
||||||
long_link: "Link"
|
long_link: "Link"
|
||||||
short_link: "Short Link"
|
short_link: "Short Link"
|
||||||
|
geo_uri: "Geo URI"
|
||||||
embed: "HTML"
|
embed: "HTML"
|
||||||
custom_dimensions: "Set custom dimensions"
|
custom_dimensions: "Set custom dimensions"
|
||||||
format: "Format:"
|
format: "Format:"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue