Commit 6cbbb8d2 authored by youjie's avatar youjie

no message

parent 5ab72e26
......@@ -657,17 +657,17 @@ export default {
if(x.MId!=651&&x.MId!=891){
source = "word-source"
}else{
if(x.MId==651)
{ source = "word-source-japan";
paintBgObj = {
"fill-color": {
'property': 'cartodb_id',
stops: that.paintRbBgList
},
"fill-outline-color": "#4f4f4f",
"fill-opacity": 0.5
if(x.MId==651){ source = "word-source-japan";
paintBgObj = {
"fill-color": {
'property': 'cartodb_id',
stops: that.paintRbBgList
},
"fill-outline-color": "#4f4f4f",
"fill-opacity": 0.5
}
}else { source = "word-source-Korea";
}else {
source = "word-source-Korea";
paintBgObj = that.paintHgBgObj
}
}
......@@ -705,29 +705,6 @@ export default {
});
},
// 编辑国家和城市
async EditCountryCity(end){
const query = await fetch(
`https://api.mapbox.com/directions/v5/mapbox/cycling/${start[0]},${start[1]};${end[0]},${end[1]}?steps=true&geometries=geojson&access_token=${mapboxgl.accessToken}`,
{ method: 'GET' }
);
const json = await query.json();
const data = json.routes[0];
const route = data.geometry.coordinates;
const geojson = {
type: 'Feature',
properties: {},
geometry: {
type: 'LineString',
coordinates: route
}
};
this.countriesData.forEach((x, i) => {
if (this.map.getSource('world-layer-'+x.MId)) {
this.map.getSource('route').setData(geojson);
}
})
},
clearCitiesMarkersHandler() {
if (this.deviceMarkers && this.deviceMarkers.length > 0) {
this.deviceMarkers.forEach(x => {
......@@ -961,6 +938,15 @@ export default {
});
marker.setLngLat(result);
marker.addTo(this.map);
const geojson = {
type: 'Feature',
properties: {},
geometry: {
type: 'LineString',
coordinates: route
}
};
let currentMarkerLngLat = marker.getLngLat();
let TripMapList = that.TripMapList.filter(y=> y.MName==x.MName)
TripMapList[0].Lng = currentMarkerLngLat.lng;
......
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