Skip to content

Commit 55794cf

Browse files
committed
Display old node versions on map view
1 parent 8cb270f commit 55794cf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/assets/javascripts/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,18 @@ $(document).ready(function () {
327327
OSM.Browse = function (map, type) {
328328
var page = {};
329329

330-
page.pushstate = page.popstate = function (path, id) {
330+
page.pushstate = page.popstate = function (path, id, version) {
331331
OSM.loadSidebarContent(path, function () {
332-
addObject(type, id);
332+
addObject(type, id, version);
333333
});
334334
};
335335

336-
page.load = function (path, id) {
337-
addObject(type, id, true);
336+
page.load = function (path, id, version) {
337+
addObject(type, id, version, true);
338338
};
339339

340-
function addObject(type, id, center) {
341-
map.addObject({ type: type, id: parseInt(id, 10) }, function (bounds) {
340+
function addObject(type, id, version, center) {
341+
map.addObject({ type: type, id: parseInt(id, 10), version: version && parseInt(version, 10) }, function (bounds) {
342342
if (!window.location.hash && bounds.isValid() &&
343343
(center || !map.getBounds().contains(bounds))) {
344344
OSM.router.withoutMoveListener(function () {
@@ -379,7 +379,7 @@ $(document).ready(function () {
379379
"/user/:display_name/history": history,
380380
"/note/:id": OSM.Note(map),
381381
"/node/:id(/history)": OSM.Browse(map, "node"),
382-
"/node/:id/history/:version": OSM.OldBrowse(),
382+
"/node/:id/history/:version": OSM.Browse(map, "node"),
383383
"/way/:id(/history)": OSM.Browse(map, "way"),
384384
"/way/:id/history/:version": OSM.OldBrowse(),
385385
"/relation/:id(/history)": OSM.Browse(map, "relation"),

0 commit comments

Comments
 (0)