|
@@ -18,6 +18,8 @@ import { Point,LineString } from "ol/geom";
|
|
import { Style, Icon,Stroke } from "ol/style";
|
|
import { Style, Icon,Stroke } from "ol/style";
|
|
import { Vector as LayerVec } from "ol/layer";
|
|
import { Vector as LayerVec } from "ol/layer";
|
|
|
|
|
|
|
|
+let ispro = process.env.NODE_ENV === "production";
|
|
|
|
+// ispro = false;
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
src: {
|
|
src: {
|
|
@@ -34,7 +36,7 @@ export default {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
var that = this;
|
|
var that = this;
|
|
- if (process.env.NODE_ENV === "production") {
|
|
|
|
|
|
+ if (ispro) {
|
|
this.initprod();
|
|
this.initprod();
|
|
} else {
|
|
} else {
|
|
this.initdev();
|
|
this.initdev();
|
|
@@ -65,7 +67,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
//[[1111,1111]]
|
|
//[[1111,1111]]
|
|
transpoints: function(points, type) {
|
|
transpoints: function(points, type) {
|
|
- if (process.env.NODE_ENV === "production") {
|
|
|
|
|
|
+ if (ispro) {
|
|
return points;
|
|
return points;
|
|
} else {
|
|
} else {
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
@@ -122,7 +124,8 @@ export default {
|
|
target: "map",
|
|
target: "map",
|
|
layers: [ign],
|
|
layers: [ign],
|
|
view: new View({
|
|
view: new View({
|
|
- zoom: 10
|
|
|
|
|
|
+ center: [0, 0],
|
|
|
|
+ zoom: 2
|
|
})
|
|
})
|
|
});
|
|
});
|
|
map
|
|
map
|
|
@@ -136,7 +139,10 @@ export default {
|
|
],
|
|
],
|
|
map.getSize()
|
|
map.getSize()
|
|
);
|
|
);
|
|
|
|
+
|
|
this.map = map;
|
|
this.map = map;
|
|
|
|
+ map.getView().setCenter(this.transpoints([[118.78, 32.04]],0)[0]);
|
|
|
|
+ map.getView().setZoom(13);
|
|
},
|
|
},
|
|
initprod: function() {
|
|
initprod: function() {
|
|
const proj3857 = getProjection("EPSG:4326");
|
|
const proj3857 = getProjection("EPSG:4326");
|
|
@@ -217,6 +223,8 @@ export default {
|
|
});
|
|
});
|
|
map.getView().fit([75.0, 20.0, 135.0, 50.0], map.getSize());
|
|
map.getView().fit([75.0, 20.0, 135.0, 50.0], map.getSize());
|
|
this.map = map;
|
|
this.map = map;
|
|
|
|
+ map.getView().setCenter(this.transpoints([[118.78, 32.04]],0)[0]);
|
|
|
|
+ map.getView().setZoom(13);
|
|
},
|
|
},
|
|
|
|
|
|
addline:function(){
|
|
addline:function(){
|