1 $(document).ready(function () {
2 var id = $("#id-embed");
5 var hashParams = OSM.params(location.hash.substring(1)),
6 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.offset) params.offset = hashParams.offset;
26 if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;
29 params.gpx = id.data("gpx");
30 } else if (hashParams.gpx) {
31 params.gpx = hashParams.gpx;
34 id.attr("src", id.data("url") + "#" + querystring.stringify(params));
36 alert(I18n.t("site.edit.id_not_configured"));