page.replace_html :sidebar_content, :partial => 'start'
page << <<EOJ
- var gml, sf, objList, currentFeature, featureList, mode = "auto", currentBounds;
+ var gml, sf, objList, currentFeature, featureList, mode = "auto", currentBounds, browsing;
OpenLayers.Feature.Vector.style['default'].strokeWidth = 3;
OpenLayers.Feature.Vector.style['default'].cursor = "pointer";
map.addControl(box);
map.events.register("moveend", map, showData);
map.events.triggerEvent("moveend");
+ browsing = true;
}
function showData() {
currentFeature = null;
}
map.events.unregister("moveend", map, showData);
+ browsing = false;
}
function startDrag() {
}
function customDataLoader(request) {
+ if (!browsing) { return; }
var doc = request.responseXML;
if (!doc || !doc.documentElement) {
currentFeature = null;
}
- function dataLoaded() {
+ function dataLoaded() {
+ if (!browsing) { return; }
$("status").innerHTML = "Loaded " + this.features.length + " features. (<a href='"+ this.url+"'>API</a>)";
objList = document.createElement("ul");
div.appendChild(h3);
var nodes = doc.getElementsByTagName(this.type);
var history = document.createElement("ul");
- for (var i = 0; i < nodes.length; i++) {
+ for (var i = nodes.length - 1; i >= 0; i--) {
var user = nodes[i].getAttribute("user") || "private user";
var timestamp = nodes[i].getAttribute("timestamp");
var item = document.createElement("li");