Commit 4459abf6 authored by 黄奎's avatar 黄奎

页面修改

parent 56d1057c
......@@ -35,7 +35,9 @@
mapboxgl.accessToken =
"pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q";
import html2Canvas from "html2canvas";
import { continueRobotMsg } from '../../../store/actions/msgs';
import {
continueRobotMsg
} from '../../../store/actions/msgs';
export default {
props: ["PostConfig"],
data() {
......@@ -95,7 +97,7 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
deviceMarkers: [], //城市Markers
allMapCityList: [], //地图显示所有城市
countriesMarkers: [], //国家的Markers
chooseCountry: [], //选中的国家
chooseCity: [], //选中的城市
};
......@@ -213,10 +215,11 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
this.map.fitBounds(bounds, {
padding: 150, // 可选:在地图边界周围添加一些内边距
});
if (this.countriesData && this.countriesData.length > 0 && this.countriesData.length == 1) {
this.map.setCenter(bounds.getCenter());
}
}
if (this.countriesData && this.countriesData.length > 0 && this.countriesData.length == 1) {
this.map.setCenter(bounds.getCenter());
}
this.addMarker(); //标记
this.createLineHandler();
await this.addCountriesMaker(); //标记国家
......@@ -232,17 +235,25 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
return cItem.ID === countryItem;
});
if (tempCountry && tempCountry.ID > 0) {
var countryLng = "";
var countryLat = "";
if (tempCountry.Lng) {
countryLng = Number(tempCountry.Lng);
}
if (tempCountry.Lng) {
countryLat = Number(tempCountry.Lat);
}
let countryObj = {
Id: 0,
MName: tempCountry.Name,
name: tempCountry.Name,
MId: tempCountry.ID,
ColorStr: this.PostConfig.TripColor ? this.PostConfig.TripColor : "#409eff",
Lng: tempCountry.Lng,
Lat: tempCountry.Lat,
longitude: tempCountry.Lng,
latitude: tempCountry.Lat,
MType:1,
Lng: countryLng,
Lat: countryLat,
longitude: countryLng,
latitude: countryLat,
MType: 1,
};
//判断是否存在国家
let tempCountryIndex = this.countriesData.findIndex(y => y.MName == countryObj.MName)
......@@ -259,6 +270,14 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
var tempCity = this.SourceCityList.find((cItem) => {
return cItem.ID === qcity;
});
var cityLng = "";
var cityLat = "";
if (tempCity.Lng) {
cityLng = Number(tempCity.Lng);
}
if (tempCity.Lng) {
cityLat = Number(tempCity.Lat);
}
var cityObj = {
Id: 0,
MName: tempCity.Name,
......@@ -266,12 +285,12 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
MId: tempCity.ID,
PMName: tempCity.CountryName,
ColorStr: this.PostConfig.TripColor ? this.PostConfig.TripColor : "#409eff",
Lng: tempCity.Lng,
Lat: tempCity.Lat,
longitude: tempCity.Lng,
latitude: tempCity.Lat,
Lng: cityLng,
Lat: cityLat,
longitude: cityLng,
latitude: cityLat,
ParentId: tempCity.CountryId,
MType:2,
MType: 2,
}
//判断城市是否存在
let tempCityIndex = this.citiesData.findIndex(y => y.MName == cityObj.MName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment