Skip to content

Commit 2ae13fa

Browse files
committed
fix(): CR request changes
1 parent 8385b9c commit 2ae13fa

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/app/packages/open-layers-map/map/open-layers-map.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -101,31 +101,25 @@ export class OpenLayersMap extends IMap<OLMap> {
101101
}
102102

103103
initMap(element: HTMLElement, layers: any, position?: CaseMapPosition) {
104-
let center = [0, 0];
105-
let zoom = 1;
106104
let rotation = 0;
107-
108105
if (position) {
109106
rotation = position.rotation;
110107
}
111-
112108
this._mapObject = new OLMap({
113109
target: element,
114110
layers: layers,
115111
renderer: 'canvas',
116112
controls: [new ScaleLine()],
117113
view: new View({
118-
center: proj.fromLonLat(center),
119-
zoom: zoom,
120-
rotation: rotation,
114+
rotation,
121115
minZoom: 2.5
122116
})
123117
});
124118

125119
this._mapLayers = layers;
126120

127121
if (position && position.extent) {
128-
this.fitToExtent(position.extent);
122+
this.fitToExtent(position.extent, position.resolution);
129123
}
130124

131125
this._mapObject.on('moveend', () => {
@@ -192,7 +186,7 @@ export class OpenLayersMap extends IMap<OLMap> {
192186
const extent = proj.transformExtent(viewExtent, oldProjection, projection);
193187
const resolution = oldview.getResolution();
194188

195-
const view: any = new View({
189+
const view: View = new View({
196190
rotation,
197191
projection,
198192
minZoom: 2.5

0 commit comments

Comments
 (0)