Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
webgis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
webgis
Commits
580bd2a6
Commit
580bd2a6
authored
Apr 01, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改地图为汽车城
parent
6d1b9d6f
Pipeline
#1047
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
71 deletions
+72
-71
main.js
public/js/main.js
+48
-48
mapconfig.json
public/mapconfig.json
+24
-23
No files found.
public/js/main.js
View file @
580bd2a6
...
...
@@ -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=12
0.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=12
1.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
;
...
...
public/mapconfig.json
View file @
580bd2a6
{
"road_edge_link"
:
true
,
"hd_edge_link"
:
true
,
"stop_line"
:
true
,
"crossing"
:
fals
e
,
"road_area"
:
true
,
"cross_area"
:
true
,
"arrow"
:
true
,
"fill_area_line"
:
fals
e
,
"fill_area"
:
fals
e
,
"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"
:
tru
e
,
"road_area"
:
true
,
"cross_area"
:
true
,
"arrow"
:
true
,
"fill_area_line"
:
tru
e
,
"fill_area"
:
tru
e
,
"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment