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.hashtags) params.hashtags = hashParams.hashtags;
24 if (hashParams.source) params.source = hashParams.source;
25 if (hashParams.disable_features) params.disable_features = hashParams.disable_features;
26 if (hashParams.offset) params.offset = hashParams.offset;
27 if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;
30 params.gpx = id.data("gpx");
31 } else if (hashParams.gpx) {
32 params.gpx = hashParams.gpx;
35 id.attr("src", id.data("url") + "#" + querystring.stringify(params));
37 alert(I18n.t("site.edit.id_not_configured"));