-<% if defined? ID_KEY %>
- <div id="map">
- <iframe frameBorder="0" id="id-embed" class="id-embed"></iframe>
- </div>
- <script>
- var coord = {};
- <% if @lat && @lon && @zoom -%>
- coord.lat = <%= @lat %>;
- coord.lon = <%= @lon %>;
- coord.zoom = <%= @zoom %>;
- <% else -%>
- coord = OSM.mapParams();
- <% end -%>
+<%= javascript_include_tag "edit/id" %>
- var hash;
- if (coord.object) {
- hash = '#id=' + coord.object.type[0] + coord.object.id;
- } else {
- hash = '#map=' + (coord.zoom || 17) + '/' + coord.lon + '/' + coord.lat
- }
-
- $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>' + hash);
- </script>
-<% else %>
- <script type="text/javascript">alert("<%= t 'site.edit.id_not_configured' %>")</script>
-<% end %>
+<div id="map">
+ <% data = { :key => ID_KEY } -%>
+ <% data[:lat] = @lat if @lat -%>
+ <% data[:lon] = @lon if @lon -%>
+ <% data[:gpx] = trace_data_url(params[:gpx], :format => :xml) if params[:gpx] -%>
+ <% data[:url] = id_url(:locale => params[:locale]) -%>
+ <%= content_tag :iframe, "", :frameBorder => 0, :id => "id-embed", :class => "id-embed", :allowfullscreen => "", :data => data %>
+</div>