diff --git a/app/views/_tailwind/authorities/show.html.erb b/app/views/_tailwind/authorities/show.html.erb index 5c1fc5288..727978938 100644 --- a/app/views/_tailwind/authorities/show.html.erb +++ b/app/views/_tailwind/authorities/show.html.erb @@ -8,9 +8,9 @@ <% if @authority.boundary && Flipper.enabled?(:show_authority_map, current_user) %> <%# TODO: Probably want to precompute the bounding box when the boundary data is loaded instead %> - <% bb = RGeo::Cartesian::BoundingBox.create_from_geometry(@authority.boundary) %>
+ x-init="initialiseAuthorityMap($el, <%= bb = RGeo::Cartesian::BoundingBox.create_from_geometry(@authority.boundary) + { json: boundary_authority_url(format: :json), sw: { lng: bb.min_x, lat: bb.min_y }, ne: { lng: bb.max_x, lat: bb.max_y } }.to_json %>)">
<% end %>