File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed 
packages/web-forms/src/components/common/map Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { fromLonLat } from 'ol/proj';
1717import  {  OSM  }  from  'ol/source' ; 
1818import  VectorSource  from  'ol/source/Vector' ; 
1919import  {  computed ,  shallowRef ,  watch  }  from  'vue' ; 
20+ import  {  get  as  getProjection  }  from  'ol/proj' ; 
2021
2122type  GeometryType  =  LineString  |  Point  |  Polygon ; 
2223
@@ -27,6 +28,7 @@ const STATES = {
2728}  as  const ; 
2829
2930const  DEFAULT_GEOJSON_PROJECTION  =  'EPSG:4326' ; 
31+ const  DEFAULT_VIEW_PROJECTION  =  'EPSG:3857' ; 
3032const  DEFAULT_VIEW_CENTER  =  [ 0 ,  0 ] ; 
3133const  MAX_ZOOM  =  16 ; 
3234const  MIN_ZOOM  =  2 ; 
@@ -66,7 +68,14 @@ export function useMapBlock() {
6668		mapInstance  =  new  Map ( { 
6769			target : mapContainer , 
6870			layers : [ new  TileLayer ( {  source : new  OSM ( )  } ) ,  featuresVectorLayer ] , 
69- 			view : new  View ( {  center : DEFAULT_VIEW_CENTER ,  zoom : MIN_ZOOM  } ) , 
71+ 			view : new  View ( { 
72+ 				center : DEFAULT_VIEW_CENTER , 
73+ 				zoom : MIN_ZOOM , 
74+ 				// Prevent map cloning at low zoom during panning, which disrupts feature selection. 
75+ 				multiWorld : false , 
76+ 				projection : DEFAULT_VIEW_PROJECTION , 
77+ 				extent : getProjection ( DEFAULT_VIEW_PROJECTION ) ?. getExtent ( ) , 
78+ 			} ) , 
7079			controls : [ new  Zoom ( ) ] , 
7180		} ) ; 
7281
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments