Browse Source
Merge pull request #7174 from vvlladd28/bug/leaflet/label/move-mouse
[3.4.2] UI: Fixed label polyline/circle follow the mouse
pull/7236/head
Igor Kulikov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/circle.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/polygon.ts
|
|
@ -102,7 +102,7 @@ export class Circle { |
|
|
const circleLabelText = fillDataPattern(this.map.circleLabelText, this.map.replaceInfoTooltipCircle, this.data); |
|
|
const circleLabelText = fillDataPattern(this.map.circleLabelText, this.map.replaceInfoTooltipCircle, this.data); |
|
|
const labelColor = this.map.ctx.widgetConfig.color; |
|
|
const labelColor = this.map.ctx.widgetConfig.color; |
|
|
this.leafletCircle.bindTooltip(`<div style="color: ${labelColor};"><b>${circleLabelText}</b></div>`, |
|
|
this.leafletCircle.bindTooltip(`<div style="color: ${labelColor};"><b>${circleLabelText}</b></div>`, |
|
|
{ className: 'tb-polygon-label', permanent: true, sticky: true, direction: 'center'}) |
|
|
{ className: 'tb-polygon-label', permanent: true, direction: 'center'}) |
|
|
.openTooltip(this.leafletCircle.getLatLng()); |
|
|
.openTooltip(this.leafletCircle.getLatLng()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -110,7 +110,7 @@ export class Polygon { |
|
|
const polygonLabelText = fillDataPattern(this.map.polygonLabelText, this.map.replaceInfoLabelPolygon, this.data); |
|
|
const polygonLabelText = fillDataPattern(this.map.polygonLabelText, this.map.replaceInfoLabelPolygon, this.data); |
|
|
const labelColor = this.map.ctx.widgetConfig.color; |
|
|
const labelColor = this.map.ctx.widgetConfig.color; |
|
|
this.leafletPoly.bindTooltip(`<div style="color: ${labelColor};"><b>${polygonLabelText}</b></div>`, |
|
|
this.leafletPoly.bindTooltip(`<div style="color: ${labelColor};"><b>${polygonLabelText}</b></div>`, |
|
|
{ className: 'tb-polygon-label', permanent: true, sticky: true, direction: 'center' }) |
|
|
{ className: 'tb-polygon-label', permanent: true, direction: 'center' }) |
|
|
.openTooltip(this.leafletPoly.getBounds().getCenter()); |
|
|
.openTooltip(this.leafletPoly.getBounds().getCenter()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|