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
a1639305
Commit
a1639305
authored
Jul 25, 2019
by
niuxiaolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest version
parent
8890c002
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
project.ts
src/app/api/model/project.ts
+3
-0
main.component.html
src/app/main/main.component.html
+7
-3
main.component.ts
src/app/main/main.component.ts
+14
-7
No files found.
src/app/api/model/project.ts
View file @
a1639305
import
{
Scetion
}
from
'./scetion'
;
/**
* 智慧监控平台文档
* 简单优雅的风格
...
...
@@ -21,4 +23,5 @@ export interface Project {
lineWidth
?:
number
;
mileage
?:
number
;
name
?:
string
;
secs
?:
Array
<
Scetion
>
;
}
src/app/main/main.component.html
View file @
a1639305
...
...
@@ -27,9 +27,13 @@
<label>
总投资:{{staticHighWay.capital}}亿
</label>
</div>
<section
*
ngIf=
"highShow"
class=
"sub"
>
<div
class =
"item"
*
ngFor=
"let prj of projects;let i=index"
>
<label
(
click
)="
highLight
(
i
,
prj
,'
project
')"
>
{{prj.name}}
</label>
<!-- <section class="sub">
<label (click)="highLight(i,sec)" *ngFor="let sec of getSecs(proj);let i=index">{{sec.name}}</label>
<label
(
click
)="
highLight
(
i
,
prj
)"
*
ngFor=
"let prj of projects;let i=index"
>
{{prj.name}}
</label
>
</section> -->
</div
>
</section>
</section>
<section>
...
...
@@ -137,7 +141,7 @@
<p>
lineStyle:
<input
type=
"text"
[(
ngModel
)]="
section
.
lineStyle
"
/></p>
<p>
lineWidth:
<input
type=
"text"
[(
ngModel
)]="
section
.
lineWidth
"
/></p>
<p>
coordinate:
<input
type=
"text"
[(
ngModel
)]="
section
.
coordinate
"
/></p>
<p>
coordinat
e:
<input
type=
"text"
[(
ngModel
)]="
section
.
mileage
"
/></p>
<p>
mileag
e:
<input
type=
"text"
[(
ngModel
)]="
section
.
mileage
"
/></p>
<button
(
click
)="
addSection
(
section
)"
>
添加
</button>
...
...
src/app/main/main.component.ts
View file @
a1639305
...
...
@@ -9,7 +9,7 @@ import { DefaultService, Project, Course, Scetion } from '../api';
import
{
HttpClient
,
HttpParams
}
from
'@angular/common/http'
;
import
{
timer
}
from
'rxjs'
;
import
{
timeInterval
,
pluck
,
take
}
from
'rxjs/operators'
;
import
{
timeInterval
,
pluck
,
take
,
tap
}
from
'rxjs/operators'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
declare
var
map
:
any
;
...
...
@@ -77,6 +77,7 @@ export class MainComponent implements OnInit {
staticNormal
:
any
=
{};
normalProjects
:
any
=
[];
currProj
:
Project
=
{};
secs
:
Array
<
Scetion
>=
[];
debug
=
false
;
toPoints
(
points
:
Array
<
Point
>
)
{
if
(
!
points
)
{
...
...
@@ -169,7 +170,7 @@ export class MainComponent implements OnInit {
corToPoint
(
json
:
string
):
Array
<
{
lng
:
number
,
lat
:
number
}
>
{
return
JSON
.
parse
(
json
).
map
(
r
=>
({
lng
:
r
[
0
],
lat
:
r
[
1
]}));
}
highLight
(
i
:
number
,
proj
:
Project
)
{
highLight
(
i
:
number
,
proj
:
Project
,
type
)
{
this
.
currProj
=
Object
.
assign
({},
proj
);
var
overlays
=
map
.
getOverlays
();
timer
(
0
,
200
)
...
...
@@ -195,6 +196,10 @@ export class MainComponent implements OnInit {
// map.addOverlay(label);
map
.
setViewport
(
points
);
}
...
...
@@ -215,6 +220,8 @@ export class MainComponent implements OnInit {
console
.
log
(
res
)
});
}
public
polylineLoaded
(
polyline
:
BPolyline
):
void
{
(
window
as
any
).
map
=
polyline
.
getMap
();
this
.
setBound
();
...
...
@@ -281,11 +288,11 @@ export class MainComponent implements OnInit {
this
.
section
.
coordinate
=
JSON
.
stringify
(
coordinates
);
this
.
modalService
.
open
(
'custom-modal-3'
);
}
document
.
getElementById
(
'result'
).
innerHTML
=
"<div><span>左下角,右上角(经纬度):</span><button class='btn'>复制</button><p class='copyText'>"
+
sw
.
lng
+
","
+
sw
.
lat
+
","
+
ne
.
lng
+
","
+
ne
.
lat
+
"</p></div>"
+
"<div><span>左下角,右上角(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>"
+
swMc
.
x
+
","
+
swMc
.
y
+
","
+
neMc
.
x
+
","
+
neMc
.
y
+
"</p></div>"
+
"<div><span>坐标集(经纬度):</span><button class='btn'>复制</button><p class='copyText'>"
+
pathStr
+
"</p></div>"
+
"<div><span>坐标集(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>"
+
pathmcStr
+
"</p></div>"
+
"<div><span>geojson:</span><button class='btn'>复制</button><p class='copyText' style='white-space:nowrap;'>"
+
JSON
.
stringify
(
geojsonStr
)
+
"</p></div>"
;
//
document.getElementById('result').innerHTML = "<div><span>左下角,右上角(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + sw.lng + "," + sw.lat + "," + ne.lng + "," + ne.lat + "</p></div>"
//
+ "<div><span>左下角,右上角(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + swMc.x + "," + swMc.y + "," + neMc.x + "," + neMc.y + "</p></div>"
//
+ "<div><span>坐标集(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + pathStr + "</p></div>"
//
+ "<div><span>坐标集(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + pathmcStr + "</p></div>"
//
+ "<div><span>geojson:</span><button class='btn'>复制</button><p class='copyText' style='white-space:nowrap;'>" + JSON.stringify(geojsonStr) + "</p></div>";
});
}).
catch
(
error
=>
console
.
log
(
error
));
...
...
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