全国地图接口测试

main
许宏杰 1 day ago
parent 74eb3e7640
commit 504e8403f1

@ -8,6 +8,7 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://192.168.0.91/gps-web/api'
# VUE_APP_BASE_API = 'http://39.101.188.84:9066'
VUE_APP_BASE_API = ''
VUE_APP_BASE_API2 = '/map'
VUE_APP_BASE_API_YUNKUN = 'http://192.168.0.91/gps-web/api'
# 路由懒加载

@ -25,3 +25,10 @@ export function getCarIdInfo(id) {
method: "get",
});
}
export function getSearchCityCount() {
return request({
url: `/ykmap/line/searchCityCount`,
method: "get",
});
}

@ -0,0 +1,69 @@
{
"china": {
"北京": { "latitude": 39.9042, "longitude": 116.4074, "pinyin": "Beijing" },
"天津": { "latitude": 39.3434, "longitude": 117.3616, "pinyin": "Tianjin" },
"河北": { "latitude": 38.0359, "longitude": 115.4698, "pinyin": "Hebei" },
"山西": { "latitude": 37.8734, "longitude": 112.562, "pinyin": "Shanxi" },
"内蒙古": {
"latitude": 40.8183,
"longitude": 111.7654,
"pinyin": "Neimenggu"
},
"辽宁": {
"latitude": 41.2954,
"longitude": 122.4927,
"pinyin": "Liaoning"
},
"吉林": { "latitude": 43.666, "longitude": 126.1924, "pinyin": "Jilin" },
"黑龙江": {
"latitude": 45.7497,
"longitude": 126.6425,
"pinyin": "Heilongjiang"
},
"上海": {
"latitude": 31.2304,
"longitude": 121.4737,
"pinyin": "Shanghai"
},
"江苏": { "latitude": 32.0617, "longitude": 118.7778, "pinyin": "Jiangsu" },
"浙江": { "latitude": 29.1592, "longitude": 120.404, "pinyin": "Zhejiang" },
"安徽": { "latitude": 31.8257, "longitude": 117.2264, "pinyin": "Anhui" },
"福建": { "latitude": 26.0789, "longitude": 119.296, "pinyin": "Fujian" },
"江西": { "latitude": 27.6143, "longitude": 115.81, "pinyin": "Jiangxi" },
"山东": {
"latitude": 36.6681,
"longitude": 118.0019,
"pinyin": "Shandong"
},
"河南": { "latitude": 34.7655, "longitude": 113.7534, "pinyin": "Henan" },
"湖北": { "latitude": 30.9756, "longitude": 112.2707, "pinyin": "Hubei" },
"湖南": { "latitude": 28.1122, "longitude": 112.9834, "pinyin": "Hunan" },
"广东": {
"latitude": 23.379,
"longitude": 113.7633,
"pinyin": "Guangdong"
},
"海南": { "latitude": 20.0174, "longitude": 110.3495, "pinyin": "Hainan" },
"重庆": {
"latitude": 29.563,
"longitude": 106.5516,
"pinyin": "Chongqing"
},
"四川": { "latitude": 30.6586, "longitude": 104.0648, "pinyin": "Sichuan" },
"贵州": { "latitude": 26.2479, "longitude": 106.7153, "pinyin": "Guizhou" },
"云南": { "latitude": 24.974, "longitude": 102.8329, "pinyin": "Yunnan" },
"西藏": { "latitude": 30.0, "longitude": 90.0, "pinyin": "Xizang" },
"陕西": { "latitude": 34.2655, "longitude": 108.9531, "pinyin": "Shaanxi" },
"甘肃": { "latitude": 36.0595, "longitude": 103.8343, "pinyin": "Gansu" },
"青海": { "latitude": 35.4998, "longitude": 95.6655, "pinyin": "Qinghai" },
"宁夏": { "latitude": 38.4711, "longitude": 106.2782, "pinyin": "Ningxia" },
"新疆": { "latitude": 43.793, "longitude": 87.5739, "pinyin": "Xinjiang" },
"香港": {
"latitude": 22.3964,
"longitude": 114.1095,
"pinyin": "Xianggang"
},
"澳门": { "latitude": 22.1987, "longitude": 113.5439, "pinyin": "Aomen" },
"台湾": { "latitude": 23.6978, "longitude": 120.9605, "pinyin": "Taiwan" }
}
}

@ -108,7 +108,7 @@ export default {
{
name: "影像地图",
type: "xyz",
url: "/map/{z}/{y}/{x}.png",
url: process.env.VUE_APP_BASE_API2 + "/map/{z}/{y}/{x}.png",
minimumLevel: 1,
maximumLevel: 16,
show: true,

@ -60,7 +60,7 @@ export default {
{
name: "影像地图",
type: "xyz",
url: "/map/{z}/{y}/{x}.png",
url: process.env.VUE_APP_BASE_API2 + "/map/{z}/{y}/{x}.png",
minimumLevel: 1,
maximumLevel: 16,
show: true,
@ -89,6 +89,7 @@ export default {
this.mapLayer.car = null;
},
created() {
console.log(process.env.VUE_APP_BASE_API, "ssssss");
const { startOfDay, endOfDay } = this.getStartAndEndOfDayFormatted(true);
this.queryParams = {
carId: this.$route.query.carId,
@ -102,6 +103,7 @@ export default {
methods: {
/**地图渲染完毕 */
mapLoad(map) {
map.set;
this.map = map;
map.fixedLight = true; // gltf
//

@ -46,7 +46,7 @@ export default {
{
name: "影像地图",
type: "xyz",
url: "/map/{z}/{y}/{x}.png",
url: process.env.VUE_APP_BASE_API2 + "/map/{z}/{y}/{x}.png",
minimumLevel: 1,
maximumLevel: 16,
show: true,

@ -16,7 +16,8 @@ import linePoint1 from "@/assets/images/linePoint1.png";
import linePoint2 from "@/assets/images/linePoint2.png";
import MarsMap from "@/components/mars-map";
import { getProvince } from "@/api/yunkun/index.js";
import { getProvince, getSearchCityCount } from "@/api/yunkun/index.js";
import provinceCentre from "@/utils/provinceCentre.json"; //
export default {
data() {
const basePathUrl = window.basePathUrl || "";
@ -52,18 +53,18 @@ export default {
contextmenu: { preventDefault: false, hasDefault: false },
},
basemaps: [
{
name: "mapbox影像图",
icon: "img/basemaps/mapboxSatellite.png",
type: "mapbox",
username: "sharealex",
styleId: "cly5i21fn00e901prgq643t4r",
token:
"pk.eyJ1Ijoic2hhcmVhbGV4IiwiYSI6ImNsaXNhZmRjbTFhbnczZmxib3h1OW05YXYifQ.PhlKv60ar3K359d8x2yBPw",
tilesize: 256,
scaleFactor: false,
show: false,
},
// {
// name: "mapbox",
// icon: "img/basemaps/mapboxSatellite.png",
// type: "mapbox",
// username: "sharealex",
// styleId: "cly5i21fn00e901prgq643t4r",
// token:
// "pk.eyJ1Ijoic2hhcmVhbGV4IiwiYSI6ImNsaXNhZmRjbTFhbnczZmxib3h1OW05YXYifQ.PhlKv60ar3K359d8x2yBPw",
// tilesize: 256,
// scaleFactor: false,
// show: false,
// },
],
},
map: null,
@ -71,7 +72,16 @@ export default {
chinaUrl: basePathUrl + "lib/geoJson/json/china.json",
};
},
created() {
this.getSearchCityCount();
},
methods: {
//f
async getSearchCityCount() {
let res = await getSearchCityCount();
this.total = res.data.count ? res.data.count : 0;
},
mapLoad(map) {
this.map = map;
@ -154,70 +164,97 @@ export default {
},
async getEchartsOption() {
// let res = await getProvince();
let res = await getProvince();
const items = [
{
level: 1,
name: "北京",
label: "beijing",
value: [116.407395, 39.904211],
symbol: "",
symbolSize: [84, 80],
},
{
level: 2,
symbol: "",
name: "沈阳",
label: "langfang",
category: 0,
active: true,
speed: 6,
value: [122.904763, 41.689105],
belong: "北京",
},
{
level: 2,
symbol: "",
name: "西宁",
category: 0,
active: true,
speed: 6,
value: [101.4038, 36.8207],
belong: "北京",
},
{
level: 2,
symbol: "",
name: "兰州",
category: 0,
active: true,
speed: 6,
value: [103.5901, 36.3043],
belong: "北京",
},
{
level: 2,
symbol: "",
name: "杭州",
category: 0,
active: true,
speed: 6,
value: [119.5313, 29.8773],
belong: "北京",
},
{
level: 2,
symbol: "",
name: "四川",
category: 0,
active: true,
speed: 6,
value: [103.9526, 30.7617],
belong: "北京",
},
];
this.total = items.length;
let items = [];
res.data.forEach((item) => {
const label = item.city.replace("省", "");
const centreItem = provinceCentre.china[label];
if (item.city == "江苏省") {
items.push({
level: 1,
name: label,
label: centreItem.pinyin,
value: [centreItem.longitude, centreItem.latitude],
symbol: "",
symbolSize: [84, 80],
});
} else {
items.push({
level: 2,
symbol: "",
name: label,
label: centreItem.pinyin,
category: 0,
active: true,
speed: 6,
value: [centreItem.longitude, centreItem.latitude],
belong: "江苏",
});
}
});
// const items = [
// {
// level: 1,
// name: "",
// label: "beijing",
// value: [116.407395, 39.904211],
// symbol: "",
// symbolSize: [84, 80],
// },
// {
// level: 2,
// symbol: "",
// name: "",
// label: "langfang",
// category: 0,
// active: true,
// speed: 6,
// value: [122.904763, 41.689105],
// belong: "",
// },
// {
// level: 2,
// symbol: "",
// name: "西",
// category: 0,
// active: true,
// speed: 6,
// value: [101.4038, 36.8207],
// belong: "",
// },
// {
// level: 2,
// symbol: "",
// name: "",
// category: 0,
// active: true,
// speed: 6,
// value: [103.5901, 36.3043],
// belong: "",
// },
// {
// level: 2,
// symbol: "",
// name: "",
// category: 0,
// active: true,
// speed: 6,
// value: [119.5313, 29.8773],
// belong: "",
// },
// {
// level: 2,
// symbol: "",
// name: "",
// category: 0,
// active: true,
// speed: 6,
// value: [103.9526, 30.7617],
// belong: "",
// },
// ];
const lineColor = ["#7BF7AD", "#7BF7AD", "##7BF7AD"];

@ -41,6 +41,7 @@ module.exports = {
["^" + process.env.VUE_APP_BASE_API]: "",
},
},
"/map": {
target: `http://192.168.0.77/map`,
pathRewrite: {

Loading…
Cancel
Save