File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11$ ( document ) . ready ( function ( ) {
22 var result_geojson ;
3+ var clipping_boundary ;
34
45 window . onbeforeunload = function ( ) {
56 return "Are you sure you want to leave? Think of your existing exports!" ;
@@ -166,6 +167,9 @@ $(document).ready(function () {
166167 if ( map . hasLayer ( resultVectorGrid ) ) {
167168 resultVectorGrid . remove ( ) ;
168169 }
170+ if ( map . hasLayer ( clipping_boundary ) ) {
171+ clipping_boundary . remove ( ) ;
172+ }
169173 }
170174
171175 function get_api_url ( ) {
@@ -384,8 +388,16 @@ $(document).ready(function () {
384388 }
385389
386390 function fit_bounds_geojson ( geojson ) {
387- var clippingBoundary = L . geoJson ( geojson ) ;
388- var bounds = clippingBoundary . getBounds ( ) ;
391+ clipping_boundary = L . geoJson ( geojson , {
392+ style : {
393+ fillOpacity : 0 ,
394+ weight : 2 ,
395+ color : "#d6403f" ,
396+ interactive : false ,
397+ } ,
398+ } ) ;
399+ clipping_boundary . addTo ( map ) ;
400+ var bounds = clipping_boundary . getBounds ( ) ;
389401 var centroid = bounds . getCenter ( ) ;
390402 var desiredZoomLevel = 18 ;
391403 map . setView ( centroid , desiredZoomLevel ) ;
You can’t perform that action at this time.
0 commit comments