return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
}
-function remoteEditHandler(bbox, select) {
+function remoteEditHandler(bbox, object) {
var loaded = false,
query = {
left: bbox.getWest() - 0.0001,
bottom: bbox.getSouth() - 0.0001
};
- if (select) query.select = select;
+ if (object) query.select = object.type + object.id;
var iframe = $('<iframe>')
.hide()
});
$("a[data-editor=remote]").click(function(e) {
- remoteEditHandler(map.getBounds());
- e.preventDefault();
+ var params = OSM.mapParams(this.search);
+ remoteEditHandler(map.getBounds(), params.object);
+ e.preventDefault();
});
if (OSM.params().edit_help) {
});
if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") {
- remoteEditHandler(map.getBounds());
+ remoteEditHandler(map.getBounds(), params.object);
OSM.router.setCurrentPath("/");
}