From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Wed, 19 Feb 2025 20:29:15 +0000 (+0100) Subject: Set zoom in id iframe data X-Git-Tag: live~148^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/154af087869566bbe3c5871d642a40ebd596cb1f?hp=-c Set zoom in id iframe data --- 154af087869566bbe3c5871d642a40ebd596cb1f diff --git a/app/assets/javascripts/edit/id.js.erb b/app/assets/javascripts/edit/id.js.erb index 0ad1be56d..c53d5e382 100644 --- a/app/assets/javascripts/edit/id.js.erb +++ b/app/assets/javascripts/edit/id.js.erb @@ -16,7 +16,7 @@ $(document).ready(function () { let zoom, lat, lon; if (idData.lat && idData.lon) { - ({ zoom, lat, lon } = { zoom: 16, ...idData }); + ({ zoom, lat, lon } = idData); } else if (!mapParams.object) { ({ zoom, lat, lon } = mapParams); } diff --git a/app/views/site/_id.html.erb b/app/views/site/_id.html.erb index 0ba4200a8..6b6c69798 100644 --- a/app/views/site/_id.html.erb +++ b/app/views/site/_id.html.erb @@ -4,6 +4,7 @@ <% data = { :configured => Settings.key?(:id_application) } data[:lat] = @lat if @lat data[:lon] = @lon if @lon + data[:zoom] = @zoom if @zoom data[:gpx] = trace_data_url(params[:gpx], :format => :xml) if params[:gpx] data[:url] = id_url(:locale => params[:locale]) %> <%= tag.iframe "", :frameBorder => 0, :id => "id-embed", :class => "w-100 h-100", :allowfullscreen => "", :data => data %>