3 $(document).ready(function () {
4 var id = $("#id-embed");
7 var hashParams = OSM.params(location.hash.substring(1));
8 var mapParams = OSM.mapParams();
11 if (mapParams.object) {
12 params.id = mapParams.object.type[0] + mapParams.object.id;
13 mapParams = OSM.parseHash(location.hash);
14 if (mapParams.center) {
15 params.map = mapParams.zoom + '/' + mapParams.center.lat + '/' + mapParams.center.lng;
17 } else if (id.data("lat") && id.data("lon")) {
18 params.map = "16/" + id.data("lat") + "/" + id.data("lon");
20 params.map = (mapParams.zoom || 17) + '/' + mapParams.lat + '/' + mapParams.lon;
23 if (hashParams.background) params.background = hashParams.background;
24 if (hashParams.comment) params.comment = hashParams.comment;
25 if (hashParams.disable_features) params.disable_features = hashParams.disable_features;
26 if (hashParams.hashtags) params.hashtags = hashParams.hashtags;
27 if (hashParams.locale) params.locale = hashParams.locale;
28 if (hashParams.maprules) params.maprules = hashParams.maprules;
29 if (hashParams.offset) params.offset = hashParams.offset;
30 if (hashParams.photo_overlay) params.photo_overlay = hashParams.photo_overlay;
31 if (hashParams.presets) params.presets = hashParams.presets;
32 if (hashParams.source) params.source = hashParams.source;
33 if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;
36 params.gpx = id.data("gpx");
37 } else if (hashParams.gpx) {
38 params.gpx = hashParams.gpx;
41 id.attr("src", id.data("url") + "#" + Qs.stringify(params));
43 alert(I18n.t("site.edit.id_not_configured"));