@mapcatch/util 1.0.13 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcatch/util",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "./dist/catchUtil.min.esm.js",
5
5
  "repository": "",
6
6
  "author": "wanyanyan",
package/src/util.js CHANGED
@@ -277,12 +277,12 @@ export function project(lngLat, zoom=12) { // 经纬度转墨卡托像素坐标
277
277
  }
278
278
  }
279
279
  export function addIcons2Map (map, icons) {
280
- icons.forEach(path => {
281
- map.loadImage(path, (error, image) => {
280
+ icons.forEach(({url, sdf}) => {
281
+ map.loadImage(url, (error, image) => {
282
282
  let iconName = path.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
  }