cd-mapgis 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/MapRender.js +1 -4
- package/src/MapView.js +13 -1
- package/src/index.d.ts +2 -1
package/package.json
CHANGED
package/src/MapRender.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Index from './index.js';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
data() {
|
|
@@ -8,9 +8,6 @@ export default {
|
|
|
8
8
|
methods: {
|
|
9
9
|
getCls() {
|
|
10
10
|
return Index;
|
|
11
|
-
},
|
|
12
|
-
onPropChange(newValue, oldValue){
|
|
13
|
-
console.log(newValue, oldValue);
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
}
|
package/src/MapView.js
CHANGED
|
@@ -7,7 +7,7 @@ import Fill from 'ol/style/Fill.js';
|
|
|
7
7
|
import VectorLayer from 'ol/layer/Vector.js';
|
|
8
8
|
import View from 'ol/View.js';
|
|
9
9
|
import Map from 'ol/Map.js';
|
|
10
|
-
|
|
10
|
+
import { fromLonLat } from 'ol/proj.js';
|
|
11
11
|
/**
|
|
12
12
|
* ol地图显示
|
|
13
13
|
*/
|
|
@@ -139,4 +139,16 @@ export default class MapView {
|
|
|
139
139
|
var newMaxY = centerY + newHeight / 2;
|
|
140
140
|
return [newMinX, newMinY, newMaxX, newMaxY];
|
|
141
141
|
}
|
|
142
|
+
setCenter(center,useAnimation){
|
|
143
|
+
if(useAnimation){
|
|
144
|
+
this.map.getView().animate({
|
|
145
|
+
center: fromLonLat(center)
|
|
146
|
+
});
|
|
147
|
+
}else{
|
|
148
|
+
this.map.getView().setCenter(center);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
setZoom(zoom){
|
|
152
|
+
this.map.getView().setZoom(zoom);
|
|
153
|
+
}
|
|
142
154
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ declare module 'cd-mapgis' {
|
|
|
5
5
|
viewOnTemplayer(p: any): void;
|
|
6
6
|
clearTemplayer(): void;
|
|
7
7
|
expandExtent(): void;
|
|
8
|
+
setCenter(center: [number, number], useAnimation?: boolean): void;
|
|
9
|
+
setZoom(zoom: number): void;
|
|
8
10
|
}
|
|
9
|
-
export * as MapRender from './MapRender.js';
|
|
10
11
|
export class OM {
|
|
11
12
|
static map: any;
|
|
12
13
|
static view: any;
|