Merge branch 'hi-ucs-dev' of http://192.168.124.50:80/wuhongjian/hi-ucs into hi-ucs-dev
This commit is contained in:
commit
033e123edc
|
@ -21,6 +21,7 @@ const restoreIconObj = {
|
|||
}
|
||||
const progress = document.getElementById('progress')
|
||||
const progressBar = document.getElementById('progress-bar')
|
||||
|
||||
function updateProgressBar(processed, total, elapsed, layersArray) {
|
||||
if (elapsed > 1000) {
|
||||
// if it takes more than a second to load, display the progress bar:
|
||||
|
@ -64,6 +65,14 @@ function createMarkerClusterLayer(layerClassName) {
|
|||
} else {
|
||||
// 使用默认图标
|
||||
markerClusterLayer = L.markerClusterGroup({
|
||||
iconCreateFunction(cluster) {
|
||||
const markers = cluster.getAllChildMarkers()
|
||||
let n = 0
|
||||
for (let i = 0; i < markers.length; i++) {
|
||||
n += markers[i].number
|
||||
}
|
||||
return L.divIcon({ html: markers.length, className: "topic-marker-cluster-video" })
|
||||
},
|
||||
// 是否允许指定 PolylineOptions 样式 spider
|
||||
spiderfyOnMaxZoom: true,
|
||||
// 是否显示标记的边界
|
||||
|
@ -111,8 +120,7 @@ function chunkData(data, doChunk, chunkCompleted) {
|
|||
* @param layerGroup
|
||||
* @return {*|void} layer对象,可以直接用map的removeLayer删除
|
||||
*/
|
||||
function addPointOnMap(
|
||||
{
|
||||
function addPointOnMap({
|
||||
feature,
|
||||
iconSize = [48, 48],
|
||||
iconUrl = 'poi.png',
|
||||
|
@ -134,8 +142,7 @@ function addPointOnMap(
|
|||
// 区分是否是自定义div图标
|
||||
if (isCustomIcon) {
|
||||
iconHtml = iconHtml || createDefaultDivIcon()
|
||||
icon = createDefaultFeatureStyle(
|
||||
{ img: iconUrl, iconSize: iconSize },
|
||||
icon = createDefaultFeatureStyle({ img: iconUrl, iconSize: iconSize },
|
||||
iconHtml,
|
||||
iconClassName
|
||||
)
|
||||
|
@ -171,12 +178,12 @@ function addPointOnMap(
|
|||
})
|
||||
}
|
||||
|
||||
return isOpenPopup
|
||||
? marker
|
||||
return isOpenPopup ?
|
||||
marker
|
||||
.addTo(mapObj.map)
|
||||
.bindPopup(elementHtml, { className: popupClassName })
|
||||
.openPopup()
|
||||
: marker.addTo(mapObj.map)
|
||||
.openPopup() :
|
||||
marker.addTo(mapObj.map)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -196,9 +203,9 @@ function createPromiseByQueryService(idArray = [], layerConfigInfo, type = '') {
|
|||
authorityFilter = 'SMID > 0'
|
||||
} else if (idArray.length <= 1000) {
|
||||
const authorityFilter1 = "'" + idArray.join("','") + "'"
|
||||
authorityFilter = type
|
||||
? `CAMERA_INDEX_CODE in (${authorityFilter1})`
|
||||
: `UUID in (${authorityFilter1})`
|
||||
authorityFilter = type ?
|
||||
`CAMERA_INDEX_CODE in (${authorityFilter1})` :
|
||||
`UUID in (${authorityFilter1})`
|
||||
} else {
|
||||
// 当UUID的个数大于1000
|
||||
const count = Math.floor(idArray.length / 1000) // 向下取整
|
||||
|
@ -209,9 +216,9 @@ function createPromiseByQueryService(idArray = [], layerConfigInfo, type = '') {
|
|||
const authorityFilterString = "'" + indexCodeSplice.join("','") + "'"
|
||||
const authorityFilterSplice = `CAMERA_INDEX_CODE in (${authorityFilterString})`
|
||||
authorityFilter =
|
||||
i === 0
|
||||
? authorityFilterSplice
|
||||
: `${authorityFilter} or ${authorityFilterSplice}`
|
||||
i === 0 ?
|
||||
authorityFilterSplice :
|
||||
`${authorityFilter} or ${authorityFilterSplice}`
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i <= count; i++) {
|
||||
|
@ -219,9 +226,9 @@ function createPromiseByQueryService(idArray = [], layerConfigInfo, type = '') {
|
|||
const authorityFilterString = "'" + indexCodeSplice.join("','") + "'"
|
||||
const authorityFilterSplice = `UUID in (${authorityFilterString})`
|
||||
authorityFilter =
|
||||
i === 0
|
||||
? authorityFilterSplice
|
||||
: `${authorityFilter} or ${authorityFilterSplice}`
|
||||
i === 0 ?
|
||||
authorityFilterSplice :
|
||||
`${authorityFilter} or ${authorityFilterSplice}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -271,9 +278,8 @@ function addResourceOnMapNew(
|
|||
// 创建图层
|
||||
let layers = null
|
||||
// 判断是否是聚合图层
|
||||
layers = layerConfig.cluster.flag
|
||||
? createMarkerClusterLayer(layerConfig.cluster.clusterName)
|
||||
: []
|
||||
layers = layerConfig.cluster.flag ?
|
||||
createMarkerClusterLayer(layerConfig.cluster.clusterName) : []
|
||||
|
||||
// 该promise用于将资源要素聚合图层添加到地图上,添加完毕之后,把状态置为已决议
|
||||
return new Promise((resolve) => {
|
||||
|
@ -347,8 +353,7 @@ function addResourceOnMapNew(
|
|||
* @return {*}
|
||||
* @private
|
||||
*/
|
||||
function addResourceOnMap(
|
||||
{
|
||||
function addResourceOnMap({
|
||||
features,
|
||||
layerName,
|
||||
layerConfigInfo,
|
||||
|
@ -658,8 +663,7 @@ function addResourceOnMapWithoutSuperMap(
|
|||
feature.traveladdress +
|
||||
'(' +
|
||||
feature.count +
|
||||
'次)</span></p>',
|
||||
{
|
||||
'次)</span></p>', {
|
||||
permanent: true,
|
||||
}
|
||||
)
|
||||
|
@ -795,8 +799,7 @@ function addPointsToMap(
|
|||
* @return {*}
|
||||
* @private
|
||||
*/
|
||||
function addResourceOnMapWithoutSuper(
|
||||
{
|
||||
function addResourceOnMapWithoutSuper({
|
||||
features,
|
||||
layerName,
|
||||
layerConfigInfo,
|
||||
|
|
Loading…
Reference in New Issue