Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
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
ReactWeb5
wisdom-components
Commits
d3664828
Commit
d3664828
authored
Dec 18, 2020
by
邹绪超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 引入管网
parent
e10f8fe6
Pipeline
#20849
passed with stages
in 4 minutes 26 seconds
Changes
7
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
166 additions
and
6 deletions
+166
-6
.umirc.js
.umirc.js
+6
-0
module.js
packages/map/src/config/module.js
+1
-0
createMap.jsx
packages/map/src/demos/createMap.jsx
+21
-3
AMapTileLayer.js
packages/map/src/extensions/layers/AMapTileLayer.js
+1
-1
index.js
packages/map/src/index.js
+0
-0
GeometryTool.js
packages/map/src/utils/GeometryTool.js
+69
-0
utils.js
packages/map/src/utils/utils.js
+68
-2
No files found.
.umirc.js
View file @
d3664828
...
@@ -85,4 +85,10 @@ export default {
...
@@ -85,4 +85,10 @@ export default {
'https://gw.alipayobjects.com/os/lib/antd/4.6.6/dist/antd-with-locales.js'
,
'https://gw.alipayobjects.com/os/lib/antd/4.6.6/dist/antd-with-locales.js'
,
]
]
:
[],
:
[],
proxy
:
{
'/CityInterface'
:
{
target
:
'http://localhost:8099'
,
changeOrigin
:
true
,
},
},
};
};
packages/map/src/config/module.js
View file @
d3664828
...
@@ -30,4 +30,5 @@ export default [
...
@@ -30,4 +30,5 @@ export default [
'gis/geometry/Point'
,
'gis/geometry/Point'
,
'dojo/_base/lang'
,
'dojo/_base/lang'
,
'gis/core/promiseUtils'
,
'gis/core/promiseUtils'
,
'gis/core/urlUtils'
,
];
];
packages/map/src/demos/createMap.jsx
View file @
d3664828
import
mapsettings
from
'../mapData'
;
import
mapsettings
from
'../mapData'
;
import
MapManganer
from
'../index'
;
import
MapManganer
from
'../index'
;
export
default
()
=>
{
export
default
class
CreateMap
extends
React
.
Component
{
return
<
MapManganer
mapsettings=
{
mapsettings
}
/>;
constructor
(
props
)
{
};
super
(
props
);
this
.
mapManganerRef
=
React
.
createRef
();
if
(
!
window
.
_config
)
{
window
.
_config
=
{
site
:
''
,
mapsettings
:
mapsettings
,
useCoverMap
:
true
,
};
}
}
componentDidMount
()
{
window
.
mapManager
=
this
.
mapManganerRef
.
current
;
}
render
()
{
return
<
MapManganer
mapsettings=
{
mapsettings
}
ref=
{
this
.
mapManganerRef
}
/>;
}
}
packages/map/src/extensions/layers/AMapTileLayer.js
View file @
d3664828
import
TilemetaUtils
from
'./support/TilemetaUtils'
;
import
TilemetaUtils
from
'./support/TilemetaUtils'
;
console
.
log
(
'Amap-tilelayer'
);
export
default
function
(
TileLayer
,
lang
,
promiseUtils
)
{
export
default
function
(
TileLayer
,
lang
,
promiseUtils
)
{
var
dpi
=
96
,
//pixel per inch
var
dpi
=
96
,
//pixel per inch
level
=
99
,
//地图缩放级数
level
=
99
,
//地图缩放级数
...
...
packages/map/src/index.js
View file @
d3664828
This diff is collapsed.
Click to expand it.
packages/map/src/utils/GeometryTool.js
0 → 100644
View file @
d3664828
import
gisConfig
from
'../config/gis'
;
import
esriLoader
from
'esri-loader'
;
console
.
log
(
'test---geometry'
);
export
function
toGeometry
(
jsonObj
,
mapMng
)
{
var
geometry
,
mm
=
mapMng
||
mapManager
;
if
(
jsonObj
)
{
jsonObj
.
spatialReference
=
{
wkid
:
mm
.
view
.
spatialReference
.
wkid
,
};
geometry
=
AllDependenciesLoadedModules
[
'jsonUtils'
].
fromJSON
(
jsonObj
);
}
return
geometry
;
}
const
toGeometryDependenciesModules
=
{
jsonUtils
:
'gis/geometry/support/jsonUtils'
,
};
const
getDefaultSymbolDependenciesModules
=
{
SimpleMarkerSymbol
:
'gis/symbols/SimpleMarkerSymbol'
,
SimpleLineSymbol
:
'gis/symbols/SimpleLineSymbol'
,
SimpleFillSymbol
:
'gis/symbols/SimpleFillSymbol'
,
Color
:
'gis/Color'
,
};
const
ALLDependenciesModules
=
Object
.
assign
(
{},
toGeometryDependenciesModules
,
getDefaultSymbolDependenciesModules
,
);
const
AllDependenciesLoadedModules
=
{};
export
async
function
loadAllDependencies
()
{
isRequestLoadModules
(
ALLDependenciesModules
,
AllDependenciesLoadedModules
)
?
await
loadCommonModules
(
ALLDependenciesModules
,
AllDependenciesLoadedModules
)
:
''
;
}
export
async
function
loadToGeometryDependencies
()
{
isRequestLoadModules
(
toGeometryDependenciesModules
,
AllDependenciesLoadedModules
)
?
await
loadCommonModules
(
toGeometryDependenciesModules
,
AllDependenciesLoadedModules
)
:
''
;
}
export
async
function
loadGetDefaultSymbolDependencies
()
{
isRequestLoadModules
(
getDefaultSymbolDependenciesModules
,
AllDependenciesLoadedModules
)
?
await
loadCommonModules
(
getDefaultSymbolDependenciesModules
,
AllDependenciesLoadedModules
)
:
''
;
}
async
function
loadCommonModules
(
modulesUrlsObject
,
loadedModuleObject
)
{
let
moduleArr
=
Object
.
entries
(
modulesUrlsObject
);
let
moduleUrlsArray
=
moduleArr
.
map
((
item
)
=>
item
[
1
]);
let
modules
=
await
esriLoader
.
loadModules
(
moduleUrlsArray
,
gisConfig
);
modules
.
map
(
function
(
module
,
index
)
{
loadedModuleObject
[
moduleArr
[
index
][
0
]]
=
module
;
}.
bind
(
this
),
);
}
function
isRequestLoadModules
(
originModules
,
targetModule
)
{
let
flag
=
false
;
for
(
let
key
in
originModules
)
{
if
(
!
flag
&&
!
targetModule
[
key
])
flag
=
true
;
}
return
flag
;
}
packages/map/src/utils/utils.js
View file @
d3664828
...
@@ -16,6 +16,72 @@ export function loadModules(modules = [], mapSettings = {}) {
...
@@ -16,6 +16,72 @@ export function loadModules(modules = [], mapSettings = {}) {
);
);
}
}
// export const urlUtils = window.urlUtils || function() {}
export
async
function
asyncLoadModules
(
modules
=
[],
mapSettings
=
{})
{
let
mergeMapSettings
=
Object
.
assign
(
gisConfig
,
mapSettings
);
let
results
=
await
esriLoader
.
loadModules
(
modules
,
mergeMapSettings
);
return
results
;
}
export
function
bindUrlUtils
(
urlUtils
)
{
if
(
!
urlUtils
.
getUrl
)
{
urlUtils
.
getUrl
=
urlUtilsGetUrl
;
}
}
function
urlUtilsGetUrl
(
template
,
_module
)
{
var
urlArr
=
[];
urlArr
.
push
(
location
.
protocol
+
'/'
);
urlArr
.
push
(
location
.
host
);
if
(
_config
.
prefix
)
{
urlArr
.
push
(
_config
.
prefix
);
}
// export urlUtils
if
(
_module
&&
_module
.
length
)
{
// url服务接口 模块配置路径采用绝对路径
var
_urlModuleTempl
=
{
CaseManageREST
:
'CityInterface/Services/CityServer_CaseManage/REST/CaseManageREST.svc'
,
EditREST
:
'CityInterface/Services/CityServer_Edit/REST/EditREST.svc'
,
MapREST
:
'CityInterface/rest/services/MapServer.svc'
,
MapRESTOld
:
'CityInterface/Services/CityServer_Map/REST/MapREST.svc'
,
WorkFlowREST
:
'CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc'
,
AuditREST
:
'CityInterface/Services/CityServer_Audit/REST/AuditREST.svc'
,
LocatorREST
:
'CityInterface/Services/CityServer_Locator/REST/LocatorREST.svc'
,
NewNotificationREST
:
'CityInterface/Services/CityServer_NewNotification/REST/NewNotificationREST.svc'
,
OfficeTemplateREST
:
'Cityinterface/Services/CityServer_OfficeTemplate/REST/OfficeTemplate.svc'
,
OfflineTaskEditREST
:
'CityInterface/Services/CityServer_OfflineTaskEdit/REST/OfflineTaskEditREST.svc'
,
PatrolStandardRest
:
'CityInterface/rest/services/PatrolStandard.svc'
,
PatrolStandardRestOld
:
'CityInterface/Services/CityServer_Patrol_Standard/REST/PatrolStandardRest.svc'
,
NewPatrolREST
:
'CityInterface/rest/services/NewPatrol.svc'
,
OldPatrolREST
:
'CityInterface/Services/CityServer_NewPatrol/REST/Newpatrolrest.svc'
,
MobileBusinessBaseREST
:
'CityInterface/Services/CityServer_MobileBusiness/REST/BaseREST.svc'
,
HZGSProjectBoxREST
:
'CityInterface/Services/CityServer_HZGSProjectBox/REST/HZGSProjectBoxREST.svc'
,
ZS_ProjectManageREST
:
'CityInterface/Services/CityServer_ProjectManage_ZS/REST/ProjectManageREST.svc'
,
};
var
_templ
=
_urlModuleTempl
[
_module
]
?
_urlModuleTempl
[
_module
]
:
''
;
urlArr
.
push
(
_templ
);
return
urlArr
.
join
(
'/'
);
}
else
{
if
(
[
'{host}'
,
'{protocol}'
,
'{prefix}'
,
'{ip}'
].
some
(
function
(
str
)
{
return
template
.
toLowerCase
().
indexOf
(
str
)
>=
0
;
})
)
{
return
template
.
replace
(
/
\{
host
\}
/gi
,
urlArr
.
join
(
'/'
))
.
replace
(
/
\{
protocol
\}
/gi
,
_config
.
protocol
+
'//'
)
.
replace
(
/
\{
prefix
\}
/gi
,
_config
.
prefix
||
''
)
.
replace
(
/
\{
ip
\}
/gi
,
_config
.
ip
);
}
else
if
(
template
.
indexOf
(
'http://'
)
==
0
||
template
.
indexOf
(
'https://'
)
==
0
)
{
return
template
;
}
else
{
urlArr
.
push
(
template
);
return
urlArr
.
join
(
'/'
);
}
}
}
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