1 <% if defined? ID_KEY %>
3 <iframe frameBorder="0" id="id-embed" class="id-embed" allowfullscreen></iframe>
8 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;
16 <% if @lat && @lon -%>
17 params.map = '16/<%= @lat %>/<%= @lon %>';
19 params.map = (mapParams.zoom || 17) + '/' + mapParams.lat + '/' + mapParams.lon;
23 var hashParams = OSM.params(location.hash.substring(1));
25 if (hashParams.background) {
26 params.background = hashParams.background;
28 if (hashParams.comment) {
29 params.comment = hashParams.comment;
31 if (hashParams.offset) {
32 params.offset = hashParams.offset;
35 <% if params[:gpx] -%>
36 params.gpx = '<%= trace_data_url(params[:gpx], :format => :xml) %>';
39 params.gpx = hashParams.gpx;
43 $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params));
46 <script type="text/javascript">alert("<%= t 'site.edit.id_not_configured' %>")</script>