Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xt-whp
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaqizhang
xt-whp
Commits
8a3f2a3e
Commit
8a3f2a3e
authored
Nov 02, 2021
by
jianqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图 关闭在点击问题,坐标被覆盖问题
parent
7189e082
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
14 deletions
+46
-14
mapUtil.js
dcit-hcsystem-hcsystem-master/src/utils/mapUtil.js
+46
-13
dangerMap.vue
...csystem-hcsystem-master/src/views/guarantee/dangerMap.vue
+0
-1
No files found.
dcit-hcsystem-hcsystem-master/src/utils/mapUtil.js
View file @
8a3f2a3e
...
...
@@ -19,7 +19,8 @@ import { Vector as VectorLayer } from "ol/layer";
import
{
Vector
as
VectorSource
,
Raster
as
RasterSource
,
Stamen
}
from
'ol/source'
;
import
Point
from
"ol/geom/Point"
;
import
Overlay
from
'ol/Overlay'
;
import
Select
from
'ol/interaction/Select'
import
Select
from
'ol/interaction/Select'
;
import
Pointer
from
"ol/interaction/Pointer"
;
import
Draw
from
'ol/interaction/Draw'
;
import
GeoJSON
from
'ol/format/GeoJSON'
;
import
Snap
from
'ol/interaction/Snap'
;
...
...
@@ -100,9 +101,9 @@ export default class Mutil {
className
:
"mapTypeC"
,
source
:
new
XYZ
({
//url: "https://t{0-7}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=c8df739f047ce17cfe41b63cbeae6997",
//url: " http://wprd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=7
",
url
:
" http://webst0{1-4}.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}
"
,
//url: " http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",
url
:
"http://wprd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=7"
,
//
url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=7",
}),
visible
:
false
,
name
:
"天地图标注(不含路网)"
,
...
...
@@ -281,14 +282,47 @@ export default class Mutil {
that
.
MAP
.
addOverlay
(
overlay
);
//点击X隐藏企业气泡
document
.
getElementById
(
`pop-close
${
id
}
`
).
onclick
=
function
()
{
//overlay.setPosition(114.514793, 38.042225)
//console.log("=="+`${id}`)
var
box
=
document
.
getElementById
(
"popup"
+
`
${
id
}
`
)
box
.
parentNode
.
removeChild
(
box
);
//console.log(document.getElementById("popup"+`${id}`))
//overlay.setPosition(undefined)
//that.Mutil.closeAllOverlays();
var
box
=
document
.
getElementById
(
"popup"
+
`
${
id
}
`
);
that
.
boxdiv
=
`
${
id
}
`
;
box
.
style
.
display
=
"none"
;
//box.parentNode.removeChild(box);
}
}
mapSelectBind
(
callbcak
)
{
//地图绑定选中feature事件
let
_this
=
this
;
let
selectPointerClick
=
new
Pointer
({
handleDownEvent
:
function
(
ev
){
let
pixel
=
ev
.
pixel
;
let
feature
=
_this
.
MAP
.
forEachFeatureAtPixel
(
pixel
,
function
(
feature
)
{
return
feature
;
}
);
if
(
feature
)
{
var
box
=
document
.
getElementById
(
"popup"
+
_this
.
boxdiv
);
// console.log(feature.ol_uid)
// console.log(_this.oluid)
if
(
_this
.
oluid
==
undefined
){
_this
.
oluid
=
feature
.
ol_uid
}
else
if
(
box
!=
null
&&
feature
.
ol_uid
==
_this
.
oluid
){
box
.
style
.
display
=
""
;
_this
.
oluid
=
feature
.
ol_uid
}
else
{
_this
.
oluid
=
feature
.
ol_uid
}
}
else
{
//callback({ flag: false }); //do something
//console.log("22")
}
}
});
_this
.
MAP
.
addInteraction
(
selectPointerClick
);
let
se
=
new
Select
({
style
:
null
,
hitTolerance
:
0
,
...
...
@@ -441,11 +475,10 @@ export default class Mutil {
color
:
'#08d527'
,
width
:
4
,
}),
font
:
'24px Calibri,sans-serif'
,
fill
:
new
Fill
({
color
:
'rgba(21, 220, 229, 0.1)'
//color: 'rgba(21, 220, 229, 0.1)'
})
fill
:
new
Fill
({
color
:
'rgba(21, 220, 229, 0.1)'
//color: 'rgba(21, 220, 229, 0.1)'
})
}),
text
:
new
Text
({
//文本样式
font
:
'12px Calibri,sans-serif'
,
...
...
dcit-hcsystem-hcsystem-master/src/views/guarantee/dangerMap.vue
View file @
8a3f2a3e
...
...
@@ -269,7 +269,6 @@
}
getMaterialWindow
(
id
:
string
)
{
let
that
=
this
;
console
.
log
(
'----------------------'
+
id
);
(
window
as
any
).
checkDetail
=
function
(
param
:
string
)
{
that
.
$router
.
push
({
path
:
"/EnDetail"
,
...
...
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