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
bdd0d46f
Commit
bdd0d46f
authored
Aug 08, 2019
by
niuxiaolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest
parent
e427699e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
main.component.html
src/app/main/main.component.html
+3
-0
main.component.ts
src/app/main/main.component.ts
+19
-1
map.service.ts
src/app/services/map.service.ts
+7
-1
No files found.
src/app/main/main.component.html
View file @
bdd0d46f
<input
[(
ngModel
)]="
step
"
>
<button
(
click
)="
test
(
step
)"
>
test
</button>
<button
(
click
)="
test
(
-step
)"
>
test2
</button>
<div
*
ngIf=
"debug"
>
标注:
<input
id=
"markerText"
type=
"text"
>
theme:
...
...
src/app/main/main.component.ts
View file @
bdd0d46f
...
...
@@ -131,6 +131,7 @@ export class MainComponent implements OnInit {
(
window
as
any
).
map
=
this
.
map
;
this
.
map
.
setMapStyleV2
({
styleJson
:
theme
});
this
.
map
.
enableScrollWheelZoom
(
true
);
this
.
map
.
enableContinuousZoom
()
this
.
map
.
centerAndZoom
(
"山西省"
,
11
);
this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
...
...
@@ -260,7 +261,20 @@ export class MainComponent implements OnInit {
//标段不定位
if
(
type
!=
's'
){
this
.
map
.
setViewport
(
points
);
// this.map.setViewport(points,{
// enableAnimation:true,
// delay:5000
// });
var
view
=
this
.
map
.
getViewport
(
points
,{
enableAnimation
:
true
,
delay
:
2000
});
this
.
map
.
panTo
(
view
.
center
,{
duration
:
1000
});
setTimeout
(()
=>
{
// this.m.dispatchWheelEvent_Chrome(document.getElementById("baidu-map"),500);
this
.
map
.
centerAndZoom
(
view
.
center
,
view
.
zoom
);
//this.map.dispatchWheelEvent_Chrome
},
1000
);
}
...
...
@@ -275,6 +289,10 @@ export class MainComponent implements OnInit {
//设置动画效果
this
.
m
.
animationLine
(
points
)
}
test
(
step
){
this
.
m
.
dispatchWheelEvent_Chrome
(
document
.
getElementById
(
"baidu-map"
),
step
);
}
setPrj
(
prj
:
Project
)
{
this
.
http
.
get
<
any
>
(
this
.
s
.
basePath
+
"/scetion/findListById/"
+
prj
.
id
).
subscribe
(
res
=>
{
...
...
src/app/services/map.service.ts
View file @
bdd0d46f
...
...
@@ -12,7 +12,13 @@ export class SelfMapService {
}
dispatchWheelEvent_Chrome
(
$el
,
delta
)
{
var
evt
=
document
.
createEvent
(
"MouseEvents"
)
as
any
;
evt
.
initEvent
(
'mousewheel'
,
true
,
true
);
evt
.
wheelDelta
=
delta
;
$el
.
dispatchEvent
(
evt
);
}
/**
* 转换为平滑点
* @param points 点
...
...
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