1 $(document).ready(function () {
2 var id = $("#id-embed");
5 var hashParams = OSM.params(location.hash.substring(1));
6 var mapParams = OSM.mapParams();
9 if (mapParams.object) {
10 params.id = mapParams.object.type[0] + mapParams.object.id;
11 mapParams = OSM.parseHash(location.hash);
12 if (mapParams.center) {
13 params.map = mapParams.zoom + '/' + mapParams.center.lat + '/' + mapParams.center.lng;
15 } else if (id.data("lat") && id.data("lon")) {
16 params.map = "16/" + id.data("lat") + "/" + id.data("lon");
18 params.map = (mapParams.zoom || 17) + '/' + mapParams.lat + '/' + mapParams.lon;
21 if (hashParams.background) params.background = hashParams.background;
22 if (hashParams.comment) params.comment = hashParams.comment;
23 if (hashParams.disable_features) params.disable_features = hashParams.disable_features;
24 if (hashParams.hashtags) params.hashtags = hashParams.hashtags;
25 if (hashParams.locale) params.locale = hashParams.locale;
26 if (hashParams.maprules) params.maprules = hashParams.maprules;
27 if (hashParams.offset) params.offset = hashParams.offset;
28 if (hashParams.photo_overlay) params.photo_overlay = hashParams.photo_overlay;
29 if (hashParams.presets) params.presets = hashParams.presets;
30 if (hashParams.source) params.source = hashParams.source;
31 if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;
34 params.gpx = id.data("gpx");
35 } else if (hashParams.gpx) {
36 params.gpx = hashParams.gpx;
39 id.attr("src", id.data("url") + "#" + qs.stringify(params));
41 alert(I18n.t("site.edit.id_not_configured"));