<% if defined? ID_KEY %>
<div id="map">
- <iframe frameBorder="0" id="id-embed" class="id-embed"></iframe>
+ <iframe frameBorder="0" id="id-embed" class="id-embed" allowfullscreen></iframe>
</div>
<script>
var params = {};
var mapParams = OSM.mapParams();
- if (mapParams.object &&
- mapParams.object.type !== 'note' &&
- mapParams.object.type !== 'changeset') {
+ if (mapParams.object) {
params.id = mapParams.object.type[0] + mapParams.object.id;
+ mapParams = OSM.parseHash(location.hash);
+ if (mapParams.center) {
+ params.map = mapParams.zoom + '/' + mapParams.center.lng + '/' + mapParams.center.lat;
+ }
} else {
<% if @lat && @lon -%>
params.map = '16/<%= @lon %>/<%= @lat %>';
}
var hashParams = OSM.params(location.hash.substring(1));
+
if (hashParams.background) {
params.background = hashParams.background;
}
+ if (hashParams.comment) {
+ params.comment = hashParams.comment;
+ }
+ if (hashParams.offset) {
+ params.offset = hashParams.offset;
+ }
+
+<% if params[:gpx] -%>
+ params.gpx = '<%= trace_data_url(params[:gpx], :format => :xml) %>';
+<% else -%>
+ if (hashParams.gpx) {
+ params.gpx = hashParams.gpx;
+ }
+<% end -%>
$('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params));
</script>