@mapcatch/util 1.0.12 → 1.0.14-a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/dist/catchUtil.min.esm.js +8 -8
- package/dist/catchUtil.min.js +1 -1
- package/package.json +1 -1
- package/src/util.js +5 -5
package/package.json
CHANGED
package/src/util.js
CHANGED
|
@@ -73,7 +73,7 @@ export function diffLayers(newList, oldList = []) { // 任务详情中的任务
|
|
|
73
73
|
// 有属性更新
|
|
74
74
|
if (['point', 'line', 'polygon'].includes(type)) {
|
|
75
75
|
cmds.push(['updateAnnotations', layer])
|
|
76
|
-
} else if (opacity !== oldOpacity || (
|
|
76
|
+
} else if (opacity !== oldOpacity || (!_.isEqual(layer.metadata, oldNode.metadata))) {
|
|
77
77
|
cmds.push(['updateLayer', layer])
|
|
78
78
|
} else if (visible !== oldVisible){
|
|
79
79
|
cmds.push([visible?'addLayer':'removeLayer', layer])
|
|
@@ -277,12 +277,12 @@ export function project(lngLat, zoom=12) { // 经纬度转墨卡托像素坐标
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
export function addIcons2Map (map, icons) {
|
|
280
|
-
icons.forEach(
|
|
281
|
-
map.loadImage(
|
|
282
|
-
let iconName =
|
|
280
|
+
icons.forEach(({url, sdf}) => {
|
|
281
|
+
map.loadImage(url, (error, image) => {
|
|
282
|
+
let iconName = url.split('/').pop().split('.')[0]
|
|
283
283
|
if(map.hasImage(iconName)) return
|
|
284
284
|
if (error) throw error
|
|
285
|
-
map.addImage(iconName, image)
|
|
285
|
+
map.addImage(iconName, image, {sdf})
|
|
286
286
|
})
|
|
287
287
|
})
|
|
288
288
|
}
|