Commit 580bd2a6 authored by oscar's avatar oscar

修改地图为汽车城

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