- if (location.protocol === "http" ||
- bowser.check({ chrome: "53", firefox: "55" })) {
- url = "http://127.0.0.1:8111/load_and_zoom?";
- } else {
- url = "https://127.0.0.1:8112/load_and_zoom?";
- }
-
- if (object) query.select = object.type + object.id;
-
- var iframe = $("<iframe>")
- .hide()
- .appendTo("body")
- .attr("src", url + qs.stringify(query))
- .on("load", function () {
- $(this).remove();
- loaded = true;
- });
+ 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));
+ }
+ });