Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
4cd04f02
authored
2020-12-15 13:54:20 +0800
by
杨威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
gis重叠分析功能实现
1 parent
3f9a05d3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
121 additions
and
61 deletions
src/assets/json/graphicSymbol.json
src/components/lineTree/lineTree.vue
src/components/lineTree/tx/importGeo.vue
src/components/lineTree/tx/js/geoUtils.js
src/components/map/EsriMap.vue
src/libs/map/IdentifyUtils.js
src/libs/map/featureUpdate.js
src/libs/map/queryUtils.js
src/views/systemTX/map.vue
src/views/systemTX/mapWeight/js/mapLayerManager.js
src/assets/json/graphicSymbol.json
View file @
4cd04f0
...
...
@@ -23,7 +23,15 @@
"color"
:
"#f50325"
,
"width"
:
1
}
},
"importSymbol"
:
{
"type"
:
"simple-fill"
,
"color"
:
[
245
,
3
,
37
,
0.4
],
"style"
:
"none"
,
"outline"
:
{
"color"
:
"#006cff"
,
"width"
:
2
}
}
}
}
\ No newline at end of file
...
...
src/components/lineTree/lineTree.vue
View file @
4cd04f0
...
...
@@ -101,7 +101,8 @@
<li
v-show=
"zdData.type == 'zdy'"
@
click=
"deleteZdy"
>
删除
</li>
</ul>
<el-dialog
title=
"导入图形"
:visible
.
sync=
"improtDialog"
>
<!--@close="closeImportDialog"-->
<el-dialog
title=
"导入图形"
:modal=
"false"
:close-on-click-modal=
"false"
custom-class=
"importDialog"
:visible
.
sync=
"improtDialog"
width=
"30%"
@
close=
"closeImportDialog"
>
<import-geo
:property-info=
"zdData"
:timeLine=
"new Date().getTime()"
:geo-info=
"currentClickZdGeo"
@
closeImportDialog=
"closeImportDialog"
></import-geo>
</el-dialog>
<!-- 添加定着物弹框 -->
...
...
@@ -430,6 +431,7 @@ export default {
}
else
{
BSM
=
this
.
zdData
.
bsm
;
}
//当确定导入图形是 跳转到图形界面
this
.
queryGeoByBsm
(
BSM
,
type
,
function
(
features
){
if
(
features
&&
features
.
length
>
0
){
if
(
features
[
0
].
geometry
){
...
...
@@ -438,6 +440,7 @@ export default {
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
self
.
postionToMap
();
self
.
improtDialog
=
true
;
self
.
currentClickZdGeo
=
features
[
0
];
}).
catch
(()
=>
{
...
...
@@ -447,11 +450,13 @@ export default {
});
});
}
else
{
self
.
postionToMap
();
self
.
currentClickZdGeo
=
features
[
0
];
self
.
improtDialog
=
true
;
}
}
else
{
self
.
postionToMap
();
self
.
currentClickZdGeo
=
null
;
self
.
improtDialog
=
true
;
}
...
...
@@ -500,7 +505,6 @@ export default {
}).then(res => {
debugger
});*/
}
else
{
self
.
$message
.
warning
(
"暂无空间信息!!!!"
);
}
...
...
@@ -574,6 +578,7 @@ export default {
//关闭图形弹框
closeImportDialog
(){
this
.
improtDialog
=
false
;
this
.
clearOverLayer
();
}
},
...
...
@@ -722,4 +727,8 @@ export default {
center
;
background-size
:
contain
;
}
/
deep
/
.importDialog
{
margin-top
:
120px
!important
;
margin-left
:
291px
;
}
</
style
>
...
...
src/components/lineTree/tx/importGeo.vue
View file @
4cd04f0
This diff is collapsed.
Click to expand it.
src/components/lineTree/tx/js/geoUtils.js
View file @
4cd04f0
This diff is collapsed.
Click to expand it.
src/components/map/EsriMap.vue
View file @
4cd04f0
...
...
@@ -37,20 +37,18 @@
MapView
,
esriMap
])
=>
{
var
map
=
new
esriMap
({
basemap
:
"hybrid"
});
//
var
map
=
new
esriMap
();
//108.95 34.27
var
view
=
new
MapView
({
container
:
self
.
viewId
,
map
:
map
,
zoom
:
10
,
zoom
:
10
,
center
:
[
-
0.154133333770497
,
0.6138183594020817
],
spatialReference
:
{
wkid
:
102100
}
});
center
:
[
-
0.154133333770497
,
0.6138183594020817
],
spatialReference
:
{
wkid
:
102100
}
});
maps
[
self
.
viewId
]
=
view
;
if
(
self
.
afterLoaderFunction
&&
typeof
self
.
afterLoaderFunction
==
'function'
){
self
.
afterLoaderFunction
(
view
);
...
...
src/libs/map/IdentifyUtils.js
View file @
4cd04f0
...
...
@@ -24,7 +24,7 @@ export default {
identifyParameters
.
tolerance
=
tolerance
?
tolerance
:
3
;
identifyParameters
.
mapExtent
=
mapExtent
?
mapExtent
:
geometry
.
extent
;
identifyParameters
.
returnGeometry
=
returnGeometry
?
returnGeometry
:
false
;
//identifyParameters.returnFieldName =
fals
e;
//identifyParameters.returnFieldName =
tru
e;
identifyParameters
.
spatialReference
=
geometry
.
spatialReference
;
identifyTask
.
execute
(
identifyParameters
).
then
(
result
=>
{
if
(
callBackFunction
&&
typeof
callBackFunction
==
'function'
){
...
...
src/libs/map/featureUpdate.js
View file @
4cd04f0
...
...
@@ -22,20 +22,29 @@ export default {
var
featureLayer
=
new
FeatureLayer
({
url
:
url
})
var
geo
=
null
;
if
(
graphic
.
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
.
geometry
);
var
saveGraphics
=
[];
if
(
!
Array
.
isArray
(
graphic
)){
graphic
=
[
graphic
];
}
for
(
var
i
=
0
;
i
<
graphic
.
length
;
i
++
){
var
geo
=
null
;
if
(
!
graphic
[
i
].
geometry
){
geo
=
null
;
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
[
i
].
geometry
);
}
var
saveGraphic
=
new
Graphic
({
attributes
:
graphic
[
i
].
attributes
,
geometry
:
geo
});
saveGraphics
.
push
(
saveGraphic
);
}
var
saveGraphic
=
new
Graphic
({
attributes
:
graphic
.
attributes
,
geometry
:
geo
});
featureLayer
.
applyEdits
({
addFeatures
:
[
saveGraphic
]
addFeatures
:
saveGraphics
}).
then
(
function
(
res
){
if
(
callBackFunction
&&
typeof
callBackFunction
==
'function'
){
callBackFunction
(
res
);
...
...
@@ -62,20 +71,30 @@ export default {
var
featureLayer
=
new
FeatureLayer
({
url
:
url
})
var
geo
=
null
;
if
(
graphic
.
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
.
geometry
);
var
updGraphics
=
[];
if
(
!
Array
.
isArray
(
graphic
)){
graphic
=
[
graphic
];
}
for
(
var
i
=
0
;
i
<
graphic
.
length
;
i
++
){
var
geo
=
null
;
if
(
!
graphic
[
i
].
geometry
){
geo
=
new
Polygon
();
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
[
i
].
geometry
);
}
var
updGraphic
=
new
Graphic
({
attributes
:
graphic
[
i
].
attributes
,
geometry
:
geo
});
updGraphics
.
push
(
updGraphic
);
}
var
updGraphic
=
new
Graphic
({
attributes
:
graphic
.
attributes
,
geometry
:
geo
});
featureLayer
.
applyEdits
({
updateFeatures
:
[
updGraphic
]
updateFeatures
:
updGraphics
}).
then
(
function
(
res
){
if
(
callBackFunction
&&
typeof
callBackFunction
==
'function'
){
callBackFunction
(
res
);
...
...
@@ -102,21 +121,31 @@ export default {
var
featureLayer
=
new
FeatureLayer
({
url
:
url
})
var
geo
=
null
;
if
(
graphic
.
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
.
geometry
);
}
else
if
(
graphic
.
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
.
geometry
);
var
delGraphics
=
[];
if
(
!
Array
.
isArray
(
graphic
)){
graphic
=
[
graphic
];
}
for
(
var
i
=
0
;
i
<
graphic
.
length
;
i
++
){
var
geo
=
null
;
if
(
!
graphic
[
i
].
geometry
){
geo
=
null
;
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'point'
){
geo
=
new
Point
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polyline'
){
geo
=
new
Polyline
(
graphic
[
i
].
geometry
);
}
else
if
(
graphic
[
i
].
geometry
.
type
==
'polygon'
){
geo
=
new
Polygon
(
graphic
[
i
].
geometry
);
}
var
delGraphic
=
new
Graphic
({
attributes
:
graphic
[
i
].
attributes
,
geometry
:
geo
});
delGraphics
.
push
(
delGraphic
);
}
var
delGraphic
=
new
Graphic
({
attributes
:
graphic
.
attributes
,
geometry
:
geo
});
featureLayer
.
applyEdits
({
deleteFeatures
:
[
delGraphic
]
deleteFeatures
:
delGraphics
}).
then
(
function
(
res
){
if
(
callBackFunction
&&
typeof
callBackFunction
==
'function'
){
callBackFunction
(
res
);
...
...
src/libs/map/queryUtils.js
View file @
4cd04f0
...
...
@@ -28,7 +28,7 @@ export default{
where
+=
" and "
;
}
if
(
Array
.
isArray
(
parames
[
i
].
value
)){
where
+=
parames
[
i
].
name
+
" in ("
+
parames
[
i
].
value
.
toString
+
")"
;
where
+=
parames
[
i
].
name
+
" in ("
+
parames
[
i
].
value
.
toString
()
+
")"
;
}
else
if
(
typeof
parames
[
i
].
value
==
'number'
){
where
+=
parames
[
i
].
name
+
" ="
+
parames
[
i
].
value
;
}
else
{
...
...
src/views/systemTX/map.vue
View file @
4cd04f0
...
...
@@ -76,15 +76,20 @@ export default {
},
mixins
:[
mapLayerManager
,
findTask
],
mounted
(){
var
query
=
this
.
$route
.
query
;
if
(
query
&&
JSON
.
stringify
(
query
)
!=
"{}"
){
//self.addGeoByBsm(query.bsm,query.type,self.viewId);
if
(
query
.
type
==
'zd'
){
this
.
getRightTree
(
query
.
bsm
)
}
else
if
(
query
.
type
==
'zrz'
){
this
.
getRightTreeByZrzbsm
(
query
.
bsm
);
var
query
=
this
.
$route
.
query
var
self
=
this
;
setTimeout
(
function
()
{
if
(
query
&&
JSON
.
stringify
(
query
)
!=
"{}"
){
//self.addGeoByBsm(query.bsm,query.type,self.viewId);
if
(
query
.
type
==
'zd'
){
self
.
getRightTree
(
query
.
bsm
)
}
else
if
(
query
.
type
==
'zrz'
){
self
.
getRightTreeByZrzbsm
(
query
.
bsm
);
}
}
}
},
500
);
},
methods
:{
...
...
@@ -94,8 +99,10 @@ export default {
view
.
ui
.
remove
(
'zoom'
);
loadModules
([
"esri/layers/MapImageLayer"
,
"esri/geometry/Extent"
]).
then
(([
MapImageLayer
,
Extent
])
=>
{
var
mapImageLayer
=
new
MapImageLayer
({
url
:
self
.
layerUrl
,
...
...
@@ -115,6 +122,13 @@ export default {
}]
});
view
.
map
.
add
(
mapImageLayer
,
1
);
mapImageLayer
.
when
(
function
()
{
var
extent
=
new
Extent
(
JSON
.
parse
(
JSON
.
stringify
(
mapImageLayer
.
fullExtent
)))
extent
.
spatialReference
=
view
.
spatialReference
;
view
.
center
=
extent
.
center
;
view
.
zoom
=
15
;
// view.extent = mapImageLayer.fullExtent;
});
var
query
=
self
.
$route
.
query
;
if
(
query
&&
JSON
.
stringify
(
query
)
!=
"{}"
){
self
.
addGeoByBsm
(
query
.
bsm
,
query
.
type
,
self
.
viewId
);
...
...
@@ -137,9 +151,11 @@ export default {
},
//图层选择事件
selectLayerChange
(){
debugger
var
self
=
this
;
this
.
features
=
[];
var
layerAndResult
=
this
.
results
.
filter
(
function
(
item
)
{
return
item
.
layerId
=
self
.
selectResLayerId
;
return
item
.
layerId
=
=
self
.
selectResLayerId
;
})
if
(
layerAndResult
){
this
.
features
=
layerAndResult
[
0
].
features
;
...
...
src/views/systemTX/mapWeight/js/mapLayerManager.js
View file @
4cd04f0
...
...
@@ -79,12 +79,12 @@ export default {
return
;
}
for
(
var
i
=
0
;
i
<
searchResult
.
length
;
i
++
){
var
layer
=
view
.
map
.
findLayerById
(
"searchResult"
+
searchResult
.
layerName
);
var
layer
=
view
.
map
.
findLayerById
(
"searchResult"
+
searchResult
[
i
].
layerId
);
if
(
layer
){
layer
.
removeAll
();
}
else
{
layer
=
new
GraphicsLayer
({
id
:
"searchResult"
+
searchResult
.
layerName
id
:
"searchResult"
+
searchResult
[
i
].
layerId
})
view
.
map
.
add
(
layer
);
}
...
...
Please
register
or
sign in
to post a comment