+ if (object && object.type !== "note") query.select = object.type + object.id; // can't select notes
+ sendRemoteEditCommand(remoteEditHost + "/load_and_zoom?" + Qs.stringify(query), function () {
+ if (object && object.type === "note") {
+ var noteQuery = { url: osmHost + OSM.apiUrl(object) };
+ sendRemoteEditCommand(remoteEditHost + "/import?" + Qs.stringify(noteQuery));
+ }
+ });
+
+ function sendRemoteEditCommand(url, callback) {
+ var iframe = $("<iframe>");
+ var timeoutId = setTimeout(function () {
+ alert(I18n.t("site.index.remote_failed"));
+ iframe.remove();
+ }, 5000);