File tree 1 file changed +3
-9
lines changed
src/app/packages/open-layers-map/map
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -101,31 +101,25 @@ export class OpenLayersMap extends IMap<OLMap> {
101
101
}
102
102
103
103
initMap ( element : HTMLElement , layers : any , position ?: CaseMapPosition ) {
104
- let center = [ 0 , 0 ] ;
105
- let zoom = 1 ;
106
104
let rotation = 0 ;
107
-
108
105
if ( position ) {
109
106
rotation = position . rotation ;
110
107
}
111
-
112
108
this . _mapObject = new OLMap ( {
113
109
target : element ,
114
110
layers : layers ,
115
111
renderer : 'canvas' ,
116
112
controls : [ new ScaleLine ( ) ] ,
117
113
view : new View ( {
118
- center : proj . fromLonLat ( center ) ,
119
- zoom : zoom ,
120
- rotation : rotation ,
114
+ rotation,
121
115
minZoom : 2.5
122
116
} )
123
117
} ) ;
124
118
125
119
this . _mapLayers = layers ;
126
120
127
121
if ( position && position . extent ) {
128
- this . fitToExtent ( position . extent ) ;
122
+ this . fitToExtent ( position . extent , position . resolution ) ;
129
123
}
130
124
131
125
this . _mapObject . on ( 'moveend' , ( ) => {
@@ -192,7 +186,7 @@ export class OpenLayersMap extends IMap<OLMap> {
192
186
const extent = proj . transformExtent ( viewExtent , oldProjection , projection ) ;
193
187
const resolution = oldview . getResolution ( ) ;
194
188
195
- const view : any = new View ( {
189
+ const view : View = new View ( {
196
190
rotation,
197
191
projection,
198
192
minZoom : 2.5
You can’t perform that action at this time.
0 commit comments