Commit 580bd2a6 authored by oscar's avatar oscar

修改地图为汽车城

parent 6d1b9d6f
Pipeline #1047 failed with stages
...@@ -145,53 +145,53 @@ function loadMap() { ...@@ -145,53 +145,53 @@ function loadMap() {
} }
}) })
//锡山全地图,shape格式不同 ////锡山全地图,shape格式不同
getjson('/testshap/xishan.json', text => { //getjson('/testshap/xishan.json', text => {
text.forEach(item => { // text.forEach(item => {
if (item.geometry.length) { // if (item.geometry.length) {
var coordinates = item.geometry // var coordinates = item.geometry
var entries = []; // var entries = [];
for (var i = 0; i < coordinates.length; i++) { // for (var i = 0; i < coordinates.length; i++) {
let text1 = load(coordinates[i][0], coordinates[i][1]); // let text1 = load(coordinates[i][0], coordinates[i][1]);
if (i == 0) { // if (i == 0) {
entries.push(text1[0]); // entries.push(text1[0]);
entries.push(text1[1]); // entries.push(text1[1]);
entries.push(heightz) // entries.push(heightz)
} else { // } else {
entries.push(text1[0]); // entries.push(text1[0]);
entries.push(text1[1]); // entries.push(text1[1]);
entries.push(heightz) // entries.push(heightz)
entries.push(text1[0]); // entries.push(text1[0]);
entries.push(text1[1]); // entries.push(text1[1]);
entries.push(heightz) // entries.push(heightz)
} // }
} // }
var geometry = new THREE.BufferGeometry(); // var geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.Float32BufferAttribute(entries, 3)); // geometry.setAttribute('position', new THREE.Float32BufferAttribute(entries, 3));
var line // var line
var lineColor // var lineColor
if (item.colorcode == '1') { // if (item.colorcode == '1') {
lineColor = COLORS.white // lineColor = COLORS.white
} else { // } else {
lineColor = COLORS.yellow // lineColor = COLORS.yellow
} // }
if (item.vrcode == '1') { // if (item.vrcode == '1') {
line = new THREE.LineSegments(geometry, new THREE.LineDashedMaterial({ // line = new THREE.LineSegments(geometry, new THREE.LineDashedMaterial({
color: lineColor, // color: lineColor,
dashSize: 3 // dashSize: 3
})); // }));
line.computeLineDistances() // line.computeLineDistances()
} else { // } else {
line = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({ // line = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({
color: lineColor, // color: lineColor,
})); // }));
} // }
scene.add(line) // scene.add(line)
} // }
}) // })
}) //})
// 预加载模型 // 预加载模型
initCarModelObj(); initCarModelObj();
...@@ -273,7 +273,7 @@ function testWeb() { ...@@ -273,7 +273,7 @@ function testWeb() {
function load(lon, lat) { function load(lon, lat) {
var tmp = '+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees +no_defs'; var tmp = '+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees +no_defs';
// var juefx = '+proj=tmerc +lat_0=0 +lon_0=121.175245120144 +k=0.99996 +x_0=0 +y_0=-3461000 +ellps=WGS84 +units=m +no_defs'; // var juefx = '+proj=tmerc +lat_0=0 +lon_0=121.175245120144 +k=0.99996 +x_0=0 +y_0=-3461000 +ellps=WGS84 +units=m +no_defs';
var juefx = '+proj=tmerc +lat_0=0 +lon_0=120.4360718809625 +k=0.99996 +x_0=0 +y_0=-3496000 +ellps=WGS84 +units=m +no_defs' var juefx = '+proj=tmerc +lat_0=0 +lon_0=121.175245120144 +k=0.99996 +x_0=0 +y_0=-3461000 +ellps=WGS84 +units=m +no_defs';
// console.log(lon, lat); // console.log(lon, lat);
var rslt = proj4(tmp, juefx).forward([lon, lat]); var rslt = proj4(tmp, juefx).forward([lon, lat]);
return rslt; return rslt;
......
{ {
"road_edge_link": true, "road_edge_link": true,
"hd_edge_link": true, "hd_edge_link": true,
"stop_line": true, "stop_line": true,
"crossing": false, "crossing": true,
"road_area": true, "road_area": true,
"cross_area": true, "cross_area": true,
"arrow": true, "arrow": true,
"fill_area_line": false, "fill_area_line": true,
"fill_area": false, "fill_area": true,
"plane_roadside": true, "plane_roadside": true,
"plane_subsidiary": true, "plane_subsidiary": true,
"road_edge_link_file_name": "../testshap/hefei_json/Road_EdgeLink.json", "road_edge_link_file_name": "../testshap/qichecheng_json/Road_EdgeLink.json",
"hd_edge_link_file_name": "../testshap/hefei_json/HD_EdgeLink.json", "hd_edge_link_file_name": "../testshap/qichecheng_json/HD_EdgeLink.json",
"stop_line_file_name": "../testshap/hefei_json/OBJ_StopLine.json", "stop_line_file_name": "../testshap/qichecheng_json/OBJ_StopLine.json",
"crossing_file_name": "../testshap/hefei_json/OBJ_Crossing.json", "crossing_file_name": "../testshap/qichecheng_json/OBJ_Crossing.json",
"road_area_file_name": "../testshap/hefei_json/OBJ_RoadArea.json", "road_area_file_name": "../testshap/qichecheng_json/OBJ_RoadArea.json",
"cross_area_file_name": "../testshap/hefei_json/Road_CrossArea.json", "cross_area_file_name": "../testshap/qichecheng_json/Road_CrossArea.json",
"arrow_file_name": "../testshap/hefei_json/OBJ_Arrow_graphical.json", "arrow_file_name": "../testshap/qichecheng_json/OBJ_Arrow_graphical.json",
"fill_area_line_file_name": "../testshap/hefei_json/OBJ_FillArea_line.json", "fill_area_line_file_name": "../testshap/qichecheng_json/OBJ_FillArea_line.json",
"fill_area_file_name": "../testshap/hefei_json/OBJ_FillArea.json", "fill_area_file_name": "../testshap/qichecheng_json/OBJ_FillArea.json",
"plane_roadside_file_name": "../testshap/hefei_json/Road_Right_Edge_plane_roadside.json", "plane_roadside_file_name": "../testshap/qichecheng_json/Road_Right_Edge_plane_roadside.json",
"plane_subsidiary_file_name": "../testshap/hefei_json/Road_Right_Edge_plane_subsidiary.json", "plane_subsidiary_file_name": "../testshap/qichecheng_json/Road_Right_Edge_plane_subsidiary.json",
"road_file_name":"../testshap/hefei_json/Road.json" "road_file_name": "../testshap/qichecheng_json/Road.json"
} }
\ No newline at end of file
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