mapping-component-package-jp 0.2.8 → 0.2.10

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": "mapping-component-package-jp",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -138,7 +138,7 @@ function formatBlockLabelMobile(Id, locname, locarea, fontFamily, fontSize, font
138
138
  nameContainerElem.remove();
139
139
  areaContainerElem.remove();
140
140
 
141
- return { nameWidth: nameWidth+2, areaWidth: areaWidth+2 };
141
+ return { nameWidth: nameWidth+5, areaWidth: areaWidth+5 };
142
142
  }
143
143
 
144
144
  export { projectMercator, tile2latLng, diffLatLng2Meters, formatBlockLabel, formatBlockLabelMobile, get_FillColorOpacity, get_FillColor }
@@ -69,6 +69,7 @@ export class IQLPolygonCustomEdit {
69
69
  let handleIconDown;
70
70
 
71
71
  if (isMobile) {
72
+ /*
72
73
  const svgpi =
73
74
  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48">' +
74
75
  '<path fill="rgba(255,255,255,0.01)" d="M 0, 24 a 24,24 0 1,0 48,0 a 24,24 0 1,0 -48,0" />' +
@@ -79,7 +80,19 @@ export class IQLPolygonCustomEdit {
79
80
  url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgpi),
80
81
  anchor: new google.maps.Point(24, 24)
81
82
  };
83
+ */
84
+ // 1. Solid Point Icon (24x24)
85
+ const svgpi =
86
+ '<svg xmlns="http://w3.org" viewBox="0 0 24 24" width="24" height="24">' +
87
+ '<path fill="#ffffff" stroke="#303030" stroke-width="1.5" d="M12 12 m-4,0 a 4,4,0 0,1 8,0 a 4,4 0 0,1 -8,0z" />' +
88
+ "</svg>";
82
89
 
90
+ pointIcon = {
91
+ url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgpi),
92
+ anchor: new google.maps.Point(12, 12) // Perfectly centered
93
+ };
94
+
95
+ /*
83
96
  const svgmpi =
84
97
  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48">' +
85
98
  '<path fill="rgba(255,255,255,0.01)" d="M 0, 24 a 24,24 0 1,0 48,0 a 24,24 0 1,0 -48,0" />' +
@@ -90,7 +103,19 @@ export class IQLPolygonCustomEdit {
90
103
  url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgmpi),
91
104
  anchor: new google.maps.Point(24, 24)
92
105
  };
106
+ */
107
+ // 2. Ghost/Midpoint Icon (24x24)
108
+ const svgmpi =
109
+ '<svg xmlns="http://w3.org" viewBox="0 0 24 24" width="24" height="24">' +
110
+ '<path fill="rgba(255,255,255,0.4)" stroke="#303030" stroke-width="0.5" d="M12 12 m-4,0 a 4,4,0 0,1 8,0 a 4,4 0 0,1 -8,0z" />' +
111
+ "</svg>";
112
+
113
+ midPointIcon = {
114
+ url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgmpi),
115
+ anchor: new google.maps.Point(12, 12)
116
+ };
93
117
 
118
+ /*
94
119
  const svgup =
95
120
  '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">' +
96
121
  '<g transform="scale(0.4 0.4)">' +
@@ -103,7 +128,20 @@ export class IQLPolygonCustomEdit {
103
128
  url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgup),
104
129
  anchor: new google.maps.Point(30, 60)
105
130
  };
131
+ */
132
+
133
+ // 3. Handle Up (Tightened Viewbox)
134
+ const svgup =
135
+ '<svg version="1.1" xmlns="http://w3.org" viewBox="0 0 24 52" width="24" height="52">' +
136
+ '<g transform="scale(0.5 0.5) translate(0, 0)">' +
137
+ '<path style="fill:#f1a81e;" d="M38.853,5.324c-7.098-7.098-18.607-7.098-25.706,0C6.751,11.72,6.031,23.763,11.459,31L26,52l14.541-21C45.969,23.763,45.249,11.72,38.853,5.324z"/>' +
138
+ "</g></svg>";
106
139
 
140
+ handleIconUp = {
141
+ url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgup),
142
+ anchor: new google.maps.Point(13, 52) // Pointing at the bottom tip
143
+ };
144
+ /*
107
145
  const svgdown =
108
146
  '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">' +
109
147
  '<g transform="scale(0.4 0.4) rotate(180 26 26)">' +
@@ -116,6 +154,19 @@ export class IQLPolygonCustomEdit {
116
154
  url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgdown),
117
155
  anchor: new google.maps.Point(30, 0)
118
156
  };
157
+ */
158
+ // 4. Handle Down (Tightened Viewbox)
159
+ const svgdown =
160
+ '<svg version="1.1" xmlns="http://w3.org" viewBox="0 0 24 52" width="24" height="52">' +
161
+ '<g transform="scale(0.5 0.5) rotate(180 26 26)">' +
162
+ '<path style="fill:#f1a81e;" d="M38.853,5.324c-7.098-7.098-18.607-7.098-25.706,0C6.751,11.72,6.031,23.763,11.459,31L26,52l14.541-21C45.969,23.763,45.249,11.72,38.853,5.324z"/>' +
163
+ "</g></svg>";
164
+
165
+ handleIconDown = {
166
+ url: "data:image/svg+xml;charset=UTF-8;base64," + btoa(svgdown),
167
+ anchor: new google.maps.Point(13, 0) // Pointing at the top tip
168
+ };
169
+
119
170
  } else {
120
171
  pointIcon = {
121
172
  path: "M4 4m-4,0a4,4,0 0,1 8,0a 4,4 0 0,1 -8,0z",
@@ -189,6 +240,12 @@ export class IQLPolygonCustomEdit {
189
240
  const vertexGhostDragEnd = function() {
190
241
  const linked = this.marker;
191
242
  if (!linked) return;
243
+
244
+ for (let j = 0; j < handles.length; j++) {
245
+ const m = handles[j]?.marker;
246
+ if (m) m.setIcon(pointIcon);
247
+ }
248
+
192
249
  const pos = this.getPosition();
193
250
  if (!pos) return;
194
251
 
@@ -293,6 +350,7 @@ export class IQLPolygonCustomEdit {
293
350
  }
294
351
 
295
352
  const vertexDragEnd = function() {
353
+ this.setIcon(pointIcon);
296
354
  google.maps.event.trigger(
297
355
  polygon,
298
356
  "update_at",
@@ -383,7 +441,8 @@ export class IQLPolygonCustomEdit {
383
441
  map,
384
442
  icon,
385
443
  draggable: true,
386
- raiseOnDrag: false
444
+ raiseOnDrag: false,
445
+ optimized: false
387
446
  });
388
447
 
389
448
  google.maps.event.addListener(vm, "dragstart", vertexDragStart);
@@ -427,7 +486,8 @@ export class IQLPolygonCustomEdit {
427
486
  map,
428
487
  icon: midPointIcon,
429
488
  draggable: true,
430
- raiseOnDrag: false
489
+ raiseOnDrag: false,
490
+ optimized: false
431
491
  });
432
492
  gm.marker = vertexMarker;
433
493
  google.maps.event.addListener(gm, "dragstart", vertexGhostDragStart);