map.events.register("moveend", map, updateData);
map.events.triggerEvent("moveend");
+ $("#browse_select_view").click(useMap);
+
$("#browse_select_box").click(startDrag);
$("#browse_hide_areas_box").html("<%=j t 'browse.start_rjs.hide_areas' %>");
useMap(true);
}
-$("#browse_select_view").click(useMap);
-
function endDrag(bbox) {
var bounds = bbox.getBounds();
var projected = bounds.clone().transform(map.getProjectionObject(), epsg4326);
$("#browse_select_view").show();
}
-function displayFeatureWarning(count, callback) {
+function displayFeatureWarning(count, limit, callback) {
clearStatus();
var div = document.createElement("div");
var p = document.createElement("p");
- p.appendChild(document.createTextNode(i18n("<%=j t 'browse.start_rjs.loaded_an_area_with_num_features' %>", { num_features: count })));
+ p.appendChild(document.createTextNode(I18n.t("browse.start_rjs.loaded_an_area_with_num_features", { num_features: count, max_features: limit })));
div.appendChild(p);
var input = document.createElement("input");
if (!this.maxFeatures || resp.features.length <= this.maxFeatures) {
options.callback.call(options.scope, resp);
} else {
- displayFeatureWarning(resp.features.length, function () {
+ displayFeatureWarning(resp.features.length, this.maxFeatures, function () {
options.callback.call(options.scope, resp);
});
}
var size = projected.getWidth() * projected.getHeight();
if (size > <%= MAX_REQUEST_AREA %>) {
- setStatus(i18n("<%=j t 'browse.start_rjs.unable_to_load_size', :max_bbox_size => MAX_REQUEST_AREA %>", { bbox_size: size }));
+ setStatus(I18n.t("browse.start_rjs.unable_to_load_size", { max_bbox_size: <%= MAX_REQUEST_AREA %>, bbox_size: size }));
} else {
loadData("/api/<%= API_VERSION %>/map?bbox=" + projected.toBBOX(), reload);
}
browseObjectList.appendChild(list);
var link = document.createElement("a");
- link.href = this.url;
+ link.href = this.protocol.url;
link.appendChild(document.createTextNode("<%=j t 'browse.start_rjs.object_list.api' %>"));
browseObjectList.appendChild(link);
table.appendChild(tr);
var heading = document.createElement("td");
- heading.appendChild(document.createTextNode(i18n("<%=j t 'browse.start_rjs.history_for_feature' %>", { feature: featureNameHistory(this.feature) })));
+ heading.appendChild(document.createTextNode(I18n.t("browse.start_rjs.history_for_feature", { feature: featureNameHistory(this.feature) })));
tr.appendChild(heading);
var td = document.createElement("td");
var user = nodes[i].getAttribute("user") || "<%=j t 'browse.start_rjs.private_user' %>";
var timestamp = nodes[i].getAttribute("timestamp");
var item = document.createElement("li");
- item.appendChild(document.createTextNode(i18n("<%=j t 'browse.start_rjs.edited_by_user_at_timestamp' %>", { user: user, timestamp: timestamp })));
+ item.appendChild(document.createTextNode(I18n.t("browse.start_rjs.edited_by_user_at_timestamp", { user: user, timestamp: timestamp })));
history.appendChild(item);
}
div.appendChild(history);
} else if (feature.attributes.name) {
return feature.attributes.name;
} else if (featureType(feature) == "node") {
- return i18n("<%=j t 'browse.start_rjs.object_list.selected.type.node' %>", { id: feature.osm_id });
+ return I18n.t("browse.start_rjs.object_list.selected.type.node", { id: feature.osm_id });
} else if (featureType(feature) == "way") {
- return i18n("<%=j t 'browse.start_rjs.object_list.selected.type.way' %>", { id: feature.osm_id });
+ return I18n.t("browse.start_rjs.object_list.selected.type.way", { id: feature.osm_id });
}
}
} else if (feature.attributes.name) {
return feature.attributes.name;
} else if (featureType(feature) == "node") {
- return i18n("<%=j t 'browse.start_rjs.object_list.history.type.node' %>", { id: feature.osm_id });
+ return I18n.t("browse.start_rjs.object_list.history.type.node", { id: feature.osm_id });
} else if (featureType(feature) == "way") {
- return i18n("<%=j t 'browse.start_rjs.object_list.history.type.way' %>", { id: feature.osm_id });
+ return I18n.t("browse.start_rjs.object_list.history.type.way", { id: feature.osm_id });
}
}