diff --git a/app/assets/images/sprite.png b/app/assets/images/sprite.png
index 9f857f852..108c38c87 100644
Binary files a/app/assets/images/sprite.png and b/app/assets/images/sprite.png differ
diff --git a/app/assets/images/sprite.svg b/app/assets/images/sprite.svg
index 2e1d309e4..dea2cccc1 100644
--- a/app/assets/images/sprite.svg
+++ b/app/assets/images/sprite.svg
@@ -13,7 +13,7 @@
height="200"
id="svg2"
version="1.1"
- inkscape:version="0.48.2 r9819"
+ inkscape:version="0.48.4 r9939"
inkscape:export-filename="/Users/tmcw/src/openstreetmap-website/app/assets/images/sprite.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
@@ -27,12 +27,12 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="5"
- inkscape:cx="159.62972"
- inkscape:cy="181.16738"
+ inkscape:zoom="1.4142136"
+ inkscape:cx="82.865988"
+ inkscape:cy="195.08379"
inkscape:document-units="px"
inkscape:current-layer="layer1"
- showgrid="true"
+ showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="756"
inkscape:window-x="0"
@@ -122,7 +122,7 @@
'+escaped.join("")+'';
-
- $("#export_html_text").val(html);
-
- if ($("#format_html").prop("checked")) {
- $("#export_html_text").prop("selected", true);
- }
- }
-
- function formatChanged() {
- $("#export_commit").show();
-
- if ($("#format_osm").prop("checked")) {
- $("#export_osm").show();
- } else {
- $("#export_osm").hide();
- }
-
- if ($("#format_mapnik").prop("checked")) {
- $("#mapnik_scale").val(getScale());
- $("#export_mapnik").show();
-
- mapnikSizeChanged();
- } else {
- $("#export_mapnik").hide();
- }
-
- if ($("#format_html").prop("checked")) {
- $("#export_html").show();
- $("#export_commit").hide();
- $("#export_html_text").prop("selected", true);
- } else {
- $("#export_html").hide();
-
- clearMarker();
- }
-
- validateControls();
- }
-
- function maxMapnikScale() {
- var size = getMercatorBounds().getSize();
-
- return Math.floor(Math.sqrt(size.x * size.y / 0.3136));
- }
-
- function mapnikImageSize(scale) {
- var size = getMercatorBounds().getSize();
-
- return {w: Math.round(size.x / scale / 0.00028),
- h: Math.round(size.y / scale / 0.00028)};
- }
-
- function roundScale(scale) {
- var precision = 5 * Math.pow(10, Math.floor(Math.LOG10E * Math.log(scale)) - 2);
-
- return precision * Math.ceil(scale / precision);
- }
-
- function mapnikSizeChanged() {
- var size = mapnikImageSize($("#mapnik_scale").val());
-
- $("#mapnik_image_width").html(size.w);
- $("#mapnik_image_height").html(size.h);
-
- validateControls();
+ $("#export_osm_too_large").toggle(getBounds().getSize() > OSM.MAX_REQUEST_AREA);
}
}
}
diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb
index 93b60c3e7..63576c06c 100644
--- a/app/assets/javascripts/index/notes.js.erb
+++ b/app/assets/javascripts/index/notes.js.erb
@@ -190,7 +190,7 @@ function initializeNotes(map, params) {
notes[feature.properties.id] = updateMarker(marker, feature);
newNote = null;
- addNoteButton.removeClass("disabled").addClass("geolink");
+ addNoteButton.removeClass("active").addClass("geolink");
}
}
@@ -223,9 +223,9 @@ function initializeNotes(map, params) {
e.preventDefault();
e.stopPropagation();
- if (addNoteButton.hasClass("disabled")) return;
+ if (addNoteButton.hasClass("active")) return;
- addNoteButton.removeClass("geolink").addClass("disabled");
+ addNoteButton.removeClass("geolink").addClass("active");
map.addLayer(noteLayer);
@@ -262,7 +262,7 @@ function initializeNotes(map, params) {
newNote.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
newNote.on("remove", function (e) {
- addNoteButton.removeClass("disabled").addClass("geolink");
+ addNoteButton.removeClass("active").addClass("geolink");
}).on("dragstart", function (e) {
$(newNote).stopTime("removenote");
}).on("dragend", function (e) {
diff --git a/app/assets/javascripts/leaflet.extend.js.erb b/app/assets/javascripts/leaflet.extend.js.erb
index a50df013e..a645ed253 100644
--- a/app/assets/javascripts/leaflet.extend.js.erb
+++ b/app/assets/javascripts/leaflet.extend.js.erb
@@ -37,6 +37,10 @@ L.extend(L.Map.prototype, {
params.mlon = marker.getLatLng().lng.toFixed(precision);
}
+ if (this._object) {
+ params[this._object.type] = this._object.id;
+ }
+
var url = 'http://' + OSM.SERVER_URL + '/',
query = querystring.stringify(params),
hash = OSM.formatHash(this);
@@ -50,7 +54,8 @@ L.extend(L.Map.prototype, {
getShortUrl: function(marker) {
var zoom = this.getZoom(),
latLng = marker && this.hasLayer(marker) ? marker.getLatLng() : this.getCenter(),
- str = '',
+ str = window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
+ 'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/',
char_array = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_~",
x = Math.round((latLng.lng + 180.0) * ((1 << 30) / 90.0)),
y = Math.round((latLng.lat + 90.0) * ((1 << 30) / 45.0)),
@@ -83,12 +88,63 @@ L.extend(L.Map.prototype, {
return (x << 1) | y;
}
+ var params = {};
+
if (marker && this.hasLayer(marker)) {
- str += '?m'
+ params.m = '';
}
- return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
- 'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/') + str;
+ if (this._object) {
+ params[this._object.type] = this._object.id;
+ }
+
+ var query = querystring.stringify(params);
+ if (query) {
+ str += '?' + query;
+ }
+
+ return str;
+ },
+
+ addObject: function(object, options) {
+ this._object = object;
+
+ if (this._objectLoader) this._objectLoader.abort();
+ if (this._objectLayer) this.removeLayer(this._objectLayer);
+
+ var map = this;
+ this._objectLoader = $.ajax({
+ url: OSM.apiUrl(object),
+ dataType: "xml",
+ success: function (xml) {
+ map._objectLayer = new L.OSM.DataLayer(null, {
+ styles: {
+ node: options.style,
+ way: options.style,
+ area: options.style
+ }
+ });
+
+ map._objectLayer.interestingNode = function (node, ways, relations) {
+ if (object.type === "node") {
+ return true;
+ } else if (object.type === "relation") {
+ for (var i = 0; i < relations.length; i++)
+ if (relations[i].members.indexOf(node) != -1)
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ map._objectLayer.addData(xml);
+
+ if (options.zoom) map.fitBounds(map._objectLayer.getBounds());
+ if (options.callback) options.callback(map._objectLayer.getBounds());
+
+ map._objectLayer.addTo(map);
+ }
+ });
}
});
diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js
index c5124e39d..d88ce5d6e 100644
--- a/app/assets/javascripts/leaflet.key.js
+++ b/app/assets/javascripts/leaflet.key.js
@@ -5,7 +5,7 @@ L.OSM.key = function (options) {
var $container = $('