-var coord = {};
-<% if @lat && @lon && @zoom -%>
-coord.lat = <%= @lat %>;
-coord.lon = <%= @lon %>;
-coord.zoom = <%= @zoom %>;
-<% else -%>
-var params = OSM.mapParams();
-coord.lat = params.lat;
-coord.lon = params.lon;
-coord.zoom = params.zoom;
-<% end -%>
-var url = 'id_iframe#map=' + coord.zoom + '/' + coord.lon + '/' + coord.lat +
- '&preauth=' + JSON.stringify(keys);
-$('#id-embed').attr('src', url);
-</script>
-<% else%>
-<script type="text/javascript">alert("<%= t 'site.edit.id_not_configured' %>")</script>
+ $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>' + hash);
+ </script>
+<% else %>
+ <script type="text/javascript">alert("<%= t 'site.edit.id_not_configured' %>")</script>