X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e731dd71a77ad4ad1e9db22535e89444bb98e5d9..97bb13595750d2ba5d03a5abe2ede7cd11a8a481:/app/assets/javascripts/index/browse.js?ds=sidebyside diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index 630944411..3f888c1cd 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -1,6 +1,5 @@ OSM.initializeBrowse = function (map) { var browseBounds; - var selectedLayer; var dataLayer = map.dataLayer; dataLayer.setStyle({ @@ -49,15 +48,20 @@ OSM.initializeBrowse = function (map) { function displayFeatureWarning(count, limit, add, cancel) { $("#browse_status").html( - $("

") - .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })) - .prepend( - $("") - .click(cancel)) + $("
") .append( - $("") - .val(I18n.t("browse.start_rjs.load_data")) - .click(add))); + $("

") + .text(I18n.t("browse.start_rjs.load_data")) + .prepend($("").click(cancel))) + .append( + $("
") + .append( + $("

") + .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit }))) + .append( + $("") + .val(I18n.t("browse.start_rjs.load_data")) + .click(add)))); } var dataLoader; @@ -87,7 +91,6 @@ OSM.initializeBrowse = function (map) { url: url, success: function (xml) { dataLayer.clearLayers(); - selectedLayer = null; var features = dataLayer.buildFeatures(xml); @@ -113,18 +116,6 @@ OSM.initializeBrowse = function (map) { } function onSelect(layer) { - // Unselect previously selected feature - if (selectedLayer) { - selectedLayer.setStyle(selectedLayer.originalStyle); - } - - // Redraw in selected style - layer.originalStyle = layer.options; - layer.setStyle({ color: "#0000ff", weight: 8 }); - OSM.router.route("/" + layer.feature.type + "/" + layer.feature.id); - - // Stash the currently drawn feature - selectedLayer = layer; } };