Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supervise-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
牛晓林
supervise-front
Commits
260aa9e4
Commit
260aa9e4
authored
Aug 12, 2019
by
niuxiaolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest ui 08/12/2019 10:38:35
parent
357ea03e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
50 deletions
+73
-50
main.component.ts
src/app/main/main.component.ts
+58
-44
map.service.ts
src/app/services/map.service.ts
+7
-1
oppc_upzuz4.js
src/assets/getmodules/oppc_upzuz4.js
+1
-1
mapv.js
src/assets/mapv.js
+7
-4
No files found.
src/app/main/main.component.ts
View file @
260aa9e4
...
...
@@ -46,7 +46,7 @@ export class MainComponent implements OnInit {
theme
:
any
;
markers
:
any
;
map
:
any
;
wheelEvent
:
any
=
{
clientX
:
944
,
clientY
:
5
88
,
currentTarget
:
document
.
getElementById
(
"baidu-map"
),
deltaX
:
0
,
deltaY
:
-
600
,
type
:
"mousewheel"
,
wheelDelta
:
450
,
wheelDeltaX
:
0
,
wheelDeltaY
:
450
,
which
:
0
,
x
:
944
,
y
:
4
88
};
wheelEvent
:
any
=
{
clientX
:
944
,
clientY
:
5
54
,
currentTarget
:
document
.
getElementById
(
"baidu-map"
),
deltaX
:
0
,
deltaY
:
-
600
,
type
:
"mousewheel"
,
wheelDelta
:
450
,
wheelDeltaX
:
0
,
wheelDeltaY
:
450
,
which
:
0
,
x
:
944
,
y
:
1
88
};
constructor
(
private
m
:
SelfMapService
,
private
router
:
Router
,
private
idService
:
IdService
,
private
route
:
ActivatedRoute
,
private
cd
:
ChangeDetectorRef
,
private
http
:
HttpClient
,
private
dynamicScriptLoader
:
DynamicScriptLoaderService
,
private
modalService
:
ModalService
,
private
s
:
DefaultService
)
{
this
.
polylineOptions
=
{
...
...
@@ -74,7 +74,7 @@ export class MainComponent implements OnInit {
course
:
Course
=
{
delFlag
:
0
};
section
:
Scetion
=
{
delFlag
:
0
};
type
=
1
;
_this
=
this
;
currentCouseId
:
any
;
staticHighWay
:
any
=
{};
staticNormal
:
any
=
{};
...
...
@@ -114,44 +114,31 @@ export class MainComponent implements OnInit {
}
ngOnInit
():
void
{
//localStorage.clear();
(
window
as
any
).
main_this
=
this
;
this
.
m
.
clearMapLocal
();
this
.
map
=
new
window
.
BMap
.
Map
((
"baidu-map"
),
{
enableMapClick
:
true
});
this
.
map
.
setMaxZoom
(
this
.
debug
==
true
?
18
:
13
);
(
window
as
any
).
map
=
this
.
map
;
// this.map.setMapStyleV2({ styleJson: theme });
var
hiddenHighIcon
=
{
"featureType"
:
"highwaysign"
,
"elementType"
:
"labels.icon"
,
"stylers"
:
{
"visibility"
:
"off"
}
}
this
.
map
.
setMapStyleV2
({
styleJson
:
hiddenHighIcon
});
this
.
map
.
enableScrollWheelZoom
();
//this.map.enableScrollWheelZoom()
this
.
map
.
enableContinuousZoom
()
//this.map.centerAndZoom("山西省",11);
var
_map
=
this
.
map
;
var
maping
=
{
8
:
11
,
9
:
15
,
10
:
20
,
11
:
22
,
12
:
25
,
13
:
26
,
14
:
28
,
15
:
29
}
this
.
map
.
addEventListener
(
"zoomend"
,
function
()
{
var
curZoom
=
_map
.
getZoom
();
var
collections
=
document
.
getElementsByClassName
(
"label-panel2"
);
var
marks
=
document
.
getElementsByClassName
(
"mark"
);
for
(
const
key
in
collections
)
{
if
(
collections
.
hasOwnProperty
(
key
))
{
const
element
=
collections
[
key
];
const
mark
=
marks
[
key
];
(
element
as
any
).
style
.
fontSize
=
maping
[
curZoom
]
+
"px"
;
(
mark
as
any
).
style
.
fontSize
=
maping
[
curZoom
]
+
"px"
;
}
}
});
this
.
setBound
();
setTimeout
(()
=>
{
this
.
others
();
},
1
);
}
others
()
{
this
.
dynamicScriptLoader
.
load
(
'drawing'
).
then
(
data
=>
{
//显示编辑按钮
(
window
as
any
).
main_this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
(
window
as
any
).
main_this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
if
(
(
window
as
any
).
main_this
.
debug
){
var
node
=
document
.
getElementsByClassName
(
'BMapLib_Drawing'
)[
0
];
(
node
as
any
).
style
.
display
=
'block'
;
}
})
// Script Loaded Successfully
drawingManager
.
addEventListener
(
'overlaycomplete'
,
e
=>
{
var
overlay
=
e
.
overlay
;
...
...
@@ -203,14 +190,41 @@ export class MainComponent implements OnInit {
});
}).
catch
(
error
=>
console
.
log
(
error
));
this
.
map
.
setMaxZoom
(
this
.
debug
==
true
?
18
:
13
);
(
window
as
any
).
map
=
this
.
map
;
// this.map.setMapStyleV2({ styleJson: theme });
this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
if
(
this
.
debug
){
var
node
=
document
.
getElementsByClassName
(
'BMapLib_Drawing'
)[
0
];
(
node
as
any
).
style
.
display
=
'block'
;
var
hiddenHighIcon
=
{
"featureType"
:
"highwaysign"
,
"elementType"
:
"labels.icon"
,
"stylers"
:
{
"visibility"
:
"off"
}
}
this
.
map
.
setMapStyleV2
({
styleJson
:
hiddenHighIcon
});
this
.
map
.
enableScrollWheelZoom
();
//this.map.enableScrollWheelZoom()
this
.
map
.
enableContinuousZoom
()
//this.map.centerAndZoom("山西省",11);
var
_map
=
this
.
map
;
var
maping
=
{
8
:
11
,
9
:
15
,
10
:
20
,
11
:
22
,
12
:
25
,
13
:
26
,
14
:
28
,
15
:
29
}
this
.
map
.
addEventListener
(
"zoomend"
,
function
()
{
var
curZoom
=
_map
.
getZoom
();
var
collections
=
document
.
getElementsByClassName
(
"label-panel2"
);
var
marks
=
document
.
getElementsByClassName
(
"mark"
);
for
(
const
key
in
collections
)
{
if
(
collections
.
hasOwnProperty
(
key
))
{
const
element
=
collections
[
key
];
const
mark
=
marks
[
key
];
(
element
as
any
).
style
.
fontSize
=
maping
[
curZoom
]
+
"px"
;
(
mark
as
any
).
style
.
fontSize
=
maping
[
curZoom
]
+
"px"
;
}
}
})
});
this
.
setBound
();
this
.
http
.
get
<
any
>
(
this
.
s
.
basePath
+
`/project/list/
${
markType
.
HIGHWAY
}
`
).
subscribe
(
res
=>
{
this
.
projects1
=
res
.
data
;
...
...
@@ -252,7 +266,6 @@ export class MainComponent implements OnInit {
this
.
http
.
get
<
any
>
(
this
.
s
.
basePath
+
"/scetion/list"
).
subscribe
(
res
=>
{
this
.
allsecs
=
res
.
data
;
});
}
proj2Change
(
$event
,
type
)
{
this
.
map
.
clearOverlays
();
...
...
@@ -360,8 +373,9 @@ export class MainComponent implements OnInit {
this
.
wheelEvent
.
target
=
document
.
getElementById
(
"baidu-map"
);
setTimeout
(()
=>
{
(
window
as
any
).
xiaolinMouseWheel
(
this
.
wheelEvent
);
(
window
as
any
).
xiaolinMouseWheel
(
this
.
wheelEvent
);
(
window
as
any
).
xiaolinMouseWheel
(
this
.
wheelEvent
);
(
window
as
any
).
xiaolinMouseWheel
(
this
.
wheelEvent
);
(
window
as
any
).
xiaolinMouseWheel
(
this
.
wheelEvent
);
},
500
);
obj
.
hadZoom
=
true
;
// setTimeout(() => {
...
...
src/app/services/map.service.ts
View file @
260aa9e4
...
...
@@ -196,7 +196,13 @@ export class SelfMapService {
}
return
curvePoints
;
}
clearMapLocal
(){
for
(
var
l
in
localStorage
){
if
(
l
.
indexOf
(
"BMap"
)
>-
1
){
localStorage
.
removeItem
(
l
);
}
}
}
/**
* 根据两点获取曲线坐标点数组
* @param Point 起点
...
...
src/assets/getmodules/oppc_upzuz4.js
View file @
260aa9e4
...
...
@@ -471,7 +471,7 @@ hh.fO = function(a, b) {
console.log('test')
e.Lk = new ub({
Hc: 60,
duration: f.U.to ?
12
00 : 1,
duration: f.U.to ?
9
00 : 1,
$b: vb.Vr,
za: function(a) {
if (b > 0) {
...
...
src/assets/mapv.js
View file @
260aa9e4
...
...
@@ -522,12 +522,15 @@
return
{
stepy
:
Math
.
sin
(
angleOf
(
p1
,
p2
))
*
step
,
stepx
:
Math
.
cos
(
angleOf
(
p1
,
p2
))
*
step
};
}
function
drawLine
(
moveStart
,
current
)
{
context
.
restore
();
context
.
lineCap
=
"round"
;
context
.
strokeStyle
=
'#fff'
;
context
.
shadowColor
=
"#015293"
;
context
.
shadowBlur
=
"0"
;
context
.
beginPath
();
context
.
moveTo
(
moveStart
.
x
,
moveStart
.
y
);
context
.
strokeStyle
=
'#fff'
;
context
.
fillStyle
=
'#fff'
;
context
.
lineWidth
=
3
;
//context.fillStyle = '#146a10';
context
.
lineWidth
=
4
;
context
.
lineTo
(
current
.
x
,
current
.
y
);
//context.fillStyle = 'rgba(7,120,249,1)';
// context.fill();
...
...
@@ -543,7 +546,7 @@
ctx
.
beginPath
();
ctx
.
arc
(
options
.
x
,
options
.
y
,
options
.
r
,
0
,
Math
.
PI
*
2
,
true
);
ctx
.
closePath
();
ctx
.
fillStyle
=
'
rgba(7,120,249,1)
'
;
ctx
.
fillStyle
=
'
#146a10
'
;
ctx
.
fill
();
ctx
.
drawImage
(
backDom
,
0
,
0
,
backDom
.
width
,
backDom
.
height
);
...
...
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