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
f81ad2ab
Commit
f81ad2ab
authored
Aug 09, 2019
by
niuxiaolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest ui 08/09/2019 15:25:06
parent
52930465
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
68 deletions
+67
-68
main.component.ts
src/app/main/main.component.ts
+67
-68
No files found.
src/app/main/main.component.ts
View file @
f81ad2ab
...
@@ -136,12 +136,66 @@ export class MainComponent implements OnInit {
...
@@ -136,12 +136,66 @@ export class MainComponent implements OnInit {
}
}
});
});
this
.
setBound
();
this
.
setBound
();
this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
})
this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
this
.
route
.
queryParamMap
.
subscribe
(
queryParams
=>
{
this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
this
.
debug
=
Boolean
(
queryParams
.
get
(
"debug"
))
if
(
this
.
debug
)
{
this
.
dynamicScriptLoader
.
load
(
'drawing'
).
then
(
data
=>
{
// Script Loaded Successfully
drawingManager
.
addEventListener
(
'overlaycomplete'
,
e
=>
{
var
overlay
=
e
.
overlay
;
var
coordinates
=
[];
if
(
overlay
.
getPath
){
var
path
=
overlay
.
getPath
();
for
(
var
i
=
0
;
i
<
path
.
length
;
i
++
)
{
coordinates
.
push
([
path
[
i
].
lng
,
path
[
i
].
lat
]);
}
}
else
{
coordinates
.
push
(
overlay
.
getPosition
())
}
if
(
overlay
.
toString
()
==
'[object Polyline]'
)
{
if
(
this
.
type
==
CordType
.
PROJ
)
{
this
.
proj
.
course
=
this
.
currentCouseId
;
this
.
proj
.
coordinate
=
JSON
.
stringify
(
coordinates
);
this
.
modalService
.
open
(
'custom-modal-1'
);
}
else
if
(
this
.
type
==
CordType
.
COURSE
)
{
this
.
course
.
coordinate
=
JSON
.
stringify
(
coordinates
);
this
.
modalService
.
open
(
'custom-modal-2'
);
}
else
if
(
this
.
type
==
CordType
.
SECTION
)
{
this
.
section
.
project
=
this
.
currentProjId
;
this
.
section
.
coordinate
=
JSON
.
stringify
(
coordinates
);
this
.
modalService
.
open
(
'custom-modal-3'
);
}
}
else
if
(
overlay
.
toString
()
==
'[object Polygon]'
)
{
// geojsonStr = {
// "type": "Polygon",
// "coordinates": [coordinates]
// };
}
else
if
(
overlay
.
toString
()
==
"[object Marker]"
){
this
.
marker
.
coordinate
=
JSON
.
stringify
(
coordinates
[
0
]);
this
.
modalService
.
open
(
'marker'
);
}
// 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
));
}
})
})
this
.
http
.
get
<
any
>
(
this
.
s
.
basePath
+
`/project/list/
${
markType
.
HIGHWAY
}
`
).
subscribe
(
res
=>
{
this
.
http
.
get
<
any
>
(
this
.
s
.
basePath
+
`/project/list/
${
markType
.
HIGHWAY
}
`
).
subscribe
(
res
=>
{
...
@@ -357,74 +411,19 @@ export class MainComponent implements OnInit {
...
@@ -357,74 +411,19 @@ export class MainComponent implements OnInit {
setTheme
(
theme
){
setTheme
(
theme
){
(
window
as
any
).
map
.
setMapStyleV2
({
styleJson
:
theme
});
(
window
as
any
).
map
.
setMapStyleV2
({
styleJson
:
theme
});
}
}
//
public polylineLoaded(polyline: BPolyline): void {
public
polylineLoaded
(
polyline
:
BPolyline
):
void
{
//
this.map = polyline.getMap();
this
.
map
=
polyline
.
getMap
();
//
this.setBound();
this
.
setBound
();
//
this.map.setMapStyleV2({ styleJson: theme });
this
.
map
.
setMapStyleV2
({
styleJson
:
theme
});
//
this.map.enableScrollWheelZoom(true);
this
.
map
.
enableScrollWheelZoom
(
true
);
//
this.map.centerAndZoom("山西省",11);
this
.
map
.
centerAndZoom
(
"山西省"
,
11
);
// this.dynamicScriptLoader.load('geouti',"mapv").then();
this
.
dynamicScriptLoader
.
load
(
'geouti'
,
"mapv"
).
then
();
// if (this.debug) {
console
.
log
(
'polyline loaded'
,
polyline
)
// this.dynamicScriptLoader.load('drawing').then(data => {
}
// // Script Loaded Successfully
// drawingManager.addEventListener('overlaycomplete', e => {
// var overlay = e.overlay;
// var coordinates = [];
// if(overlay.getPath){
// var path = overlay.getPath();
// for (var i = 0; i < path.length; i++) {
// coordinates.push([path[i].lng, path[i].lat]);
// }
// }else{
// coordinates.push(overlay.getPosition())
// }
// if (overlay.toString() == '[object Polyline]') {
// if (this.type == CordType.PROJ) {
// this.proj.course = this.currentCouseId;
// this.proj.coordinate = JSON.stringify(coordinates);
// this.modalService.open('custom-modal-1');
// }
// else if (this.type == CordType.COURSE) {
// this.course.coordinate = JSON.stringify(coordinates);
// this.modalService.open('custom-modal-2');
// }
// else if (this.type == CordType.SECTION) {
// this.section.project = this.currentProjId;
// this.section.coordinate = JSON.stringify(coordinates);
// this.modalService.open('custom-modal-3');
// }
// }
// else if (overlay.toString() == '[object Polygon]') {
// // geojsonStr = {
// // "type": "Polygon",
// // "coordinates": [coordinates]
// // };
// }else if(overlay.toString() == "[object Marker]"){
// this.marker.coordinate = JSON.stringify(coordinates[0]);
// this.modalService.open('marker');
// }
// // 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));
// }
// console.log('polyline loaded', polyline)
// }
...
...
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