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) {
var objectStyle = {
color: "#FF6200",
.text(I18n.t('javascripts.share.paste_html'))
.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
var $imageSection = $('<div>')
'<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
+ // Geo URI
+
+ $('#geo_uri')
+ .attr('href', map.getGeoUri(marker))
+ .html(map.getGeoUri(marker));
+
// Image
if (locationFilter.isEnabled()) {
text-decoration: none;
background-color: $lightblue;
padding: 5px 10px;
+ border-right: 1px solid #fff;
}
a:first-child {
}
a:last-child {
- border-left: 1px solid #fff;
border-radius: 0 4px 4px 0;
}