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.offset) params.offset = hashParams.offset;
24 if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough;
27 params.gpx = id.data("gpx");
28 } else if (hashParams.gpx) {
29 params.gpx = hashParams.gpx;
32 id.attr("src", id.data("url") + "#" + querystring.stringify(params));
34 alert(I18n.t("site.edit.id_not_configured"));