Ver Fonte

test(gis): sync accepted marker label offset

Kazerin há 1 mês atrás
pai
commit
404bbf01ce
2 ficheiros alterados com 3 adições e 3 exclusões
  1. 2 2
      src/components/GisMapCanvas.vue
  2. 1 1
      tests/gisMapCanvas.test.mjs

+ 2 - 2
src/components/GisMapCanvas.vue

@@ -127,7 +127,7 @@ function addPointMarker(BMapGL, point) {
   if (props.showMarkerName && name) {
     const label = new BMapGL.Label(`<div class="gis-marker-label-text">${escapeHtml(name)}</div>`, {
       position,
-      offset: new BMapGL.Size(-28, -props.markerSize - 24)
+      offset: new BMapGL.Size(-28, -props.markerSize - 18)
     })
     label.setStyle({ border: 'none', background: 'transparent', padding: '0' })
     label.addEventListener('click', (event) => {
@@ -178,7 +178,7 @@ function addLine(BMapGL, line) {
     if (!props.showMarkerName) return
     const label = new BMapGL.Label(`<div class="gis-marker-label-text">${escapeHtml(name)}</div>`, {
       position,
-      offset: new BMapGL.Size(-28, -props.markerSize - 24)
+      offset: new BMapGL.Size(-28, -props.markerSize - 18)
     })
     label.setStyle({ border: 'none', background: 'transparent', padding: '0' })
     label.addEventListener('click', (event) => {

+ 1 - 1
tests/gisMapCanvas.test.mjs

@@ -29,7 +29,7 @@ test('shared gis map canvas renders every point as an official icon with a label
   assert.match(source, /anchor: new BMapGL\.Size\(size \/ 2, size\)/u)
   assert.match(source, /const marker = new BMapGL\.Marker\(position, \{/u)
   assert.match(source, /new BMapGL\.Label\(`<div class="gis-marker-label-text">/u)
-  assert.match(source, /offset: new BMapGL\.Size\(-28, -props\.markerSize - 24\)/u)
+  assert.match(source, /offset: new BMapGL\.Size\(-28, -props\.markerSize - 18\)/u)
   assert.match(source, /width: 56px/u)
   assert.match(source, /overflow-wrap: anywhere/u)
   assert.doesNotMatch(source, /white-space: nowrap/u)