waibu-maps 2.1.6 → 2.2.1

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.
@@ -141,9 +141,9 @@ class WaibuMaps { // eslint-disable-line no-unused-vars
141
141
  this.map.addImage(src.name, image.data)
142
142
  }
143
143
 
144
- loadIcon = async (icon) => {
144
+ loadIcon = async (icon, prefix) => {
145
145
  if (this.map.listImages().includes(icon)) return
146
- const href = this.iconPrefix + icon.split(':')[1]
146
+ const href = (prefix ?? this.iconPrefix) + icon.split(':')[1]
147
147
  const image = await this.map.loadImage(href)
148
148
  if (!this.map.listImages().includes(icon)) this.map.addImage(icon, image.data)
149
149
  }
@@ -2,8 +2,8 @@ import wmapsBase from '../wmaps-base.js'
2
2
 
3
3
  export function buildLayers (params) {
4
4
  const { isString, map } = this.app.lib._
5
- const { routePath } = this.app.waibu
6
- const { attrToArray, jsonStringify } = this.app.waibuMpa
5
+ const { routePath, attrToArray } = this.app.waibu
6
+ const { jsonStringify } = this.app.waibuMpa
7
7
 
8
8
  if (!isString(params.attr.layer)) return ''
9
9
  const items = map(attrToArray(params.attr.layer), item => routePath(item))
@@ -18,8 +18,8 @@ export function buildLayers (params) {
18
18
 
19
19
  export function buildImage (params) {
20
20
  const { isString, map } = this.app.lib._
21
- const { routePath } = this.app.waibu
22
- const { attrToArray, jsonStringify } = this.app.waibuMpa
21
+ const { routePath, attrToArray } = this.app.waibu
22
+ const { jsonStringify } = this.app.waibuMpa
23
23
 
24
24
  if (!isString(params.attr.image)) return ''
25
25
  const items = map(attrToArray(params.attr.image), item => routePath(item))
@@ -65,8 +65,8 @@ async function layerHtmlCluster () {
65
65
 
66
66
  build = async () => {
67
67
  const { generateId } = this.app.lib.aneka
68
- const { attrToArray, jsonStringify } = this.app.waibuMpa
69
- const { fetch, routePath } = this.app.waibu
68
+ const { jsonStringify } = this.app.waibuMpa
69
+ const { fetch, routePath, attrToArray } = this.app.waibu
70
70
  const { isString } = this.app.lib._
71
71
  if (!this.params.attr.src) return
72
72
  this.params.attr.name = this.params.attr.name ?? generateId('alpha')
@@ -11,7 +11,7 @@ export const opts = {
11
11
 
12
12
  async function options (params = {}) {
13
13
  const { camelCase, isString } = this.app.lib._
14
- const { attrToArray } = this.app.waibuMpa
14
+ const { attrToArray } = this.app.waibu
15
15
  const { routePath } = this.app.waibu
16
16
  const mapOpts = this.app.waibuMaps.getConfig().mapOptions
17
17
  mapOpts.container = params.attr.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-maps",
3
- "version": "2.1.6",
3
+ "version": "2.2.1",
4
4
  "description": "Maps for Waibu MPA",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-25
4
+
5
+ - [2.2.1] Bug fix on ```wmaps.loadIcon()```
6
+
7
+ ## 2026-02-18
8
+
9
+ - [2.2.0] Update attribute functions from ```waibu```
10
+
3
11
  ## 2026-02-15
4
12
 
5
13
  - [2.1.6] Bug fix on ```<:wmaps-control-search />``` feed labeling