my-openlayer 0.1.16 → 0.1.17
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/dist/core/Polygon.js +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/core/Polygon.js
CHANGED
|
@@ -68,7 +68,7 @@ export default class Polygon {
|
|
|
68
68
|
fill: new Fill({ color: options?.fillColor || 'rgba(255, 255, 255, 0.3)' }),
|
|
69
69
|
});
|
|
70
70
|
if (options?.textVisible) {
|
|
71
|
-
const text = options?.
|
|
71
|
+
const text = (options?.textCallBack ? options?.textCallBack(feature) : '') || (options.nameKey ? feature.get(options.nameKey) : "");
|
|
72
72
|
featureStyle.setText(new Text({
|
|
73
73
|
text: text,
|
|
74
74
|
font: options?.textFont ?? '14px Calibri,sans-serif',
|
|
@@ -118,7 +118,7 @@ export default class Polygon {
|
|
|
118
118
|
fill: new Fill({ color: newColor || options?.fillColor || 'rgba(255, 255, 255, 0.3)' }),
|
|
119
119
|
});
|
|
120
120
|
if (options?.textVisible) {
|
|
121
|
-
const text = options?.
|
|
121
|
+
const text = (options?.textCallBack ? options?.textCallBack(feature) : '') || (options.nameKey ? feature.get(options.nameKey) : "");
|
|
122
122
|
featureStyle.setText(new Text({
|
|
123
123
|
text,
|
|
124
124
|
font: options?.textFont ?? '14px Calibri,sans-serif',
|
package/dist/types.d.ts
CHANGED