Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/jsvectormap/src/js/elements/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import baseElement from './baseElement'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
class Marker extends baseElement {
constructor({ index, style, label, cx, cy, map, group }) {
super()
// Private
this._map = map
this._isImage = !!style.initial.image
// Protected
this.config = arguments[0]
this.shape = map.canvas[this._isImage ? 'createImage' : 'createCircle']({ dataIndex: index, cx, cy }, this._getStyle(), group)
this.shape.addClass('jvm-marker jvm-element')
if (this._isImage) {
this.updateLabelPosition()
}
if (label) {
this._createLabel(this.config)
}
}
updateLabelPosition() {
if (this.label) {
this.label.set({
x: this._labelX * this._map.scale + this._offsets[0] +
this._map.transX * this._map.scale + 5 + (
this._isImage ? (this.shape.width || 0) / 2 : this.shape.node.r.baseVal.value
),
y: this._labelY * this._map.scale + this._map.transY * this._map.scale + this._offsets[1]
})
}
}
_createLabel({ index, map, label, labelsGroup, cx, cy, marker, isRecentlyCreated }) {
let labelText = this.getLabelText(index, label)
this._labelX = cx / map.scale - map.transX
this._labelY = cy / map.scale - map.transY
this._offsets = isRecentlyCreated && marker.offsets ? marker.offsets : this.getLabelOffsets(index, label)
this.label = map.canvas.createText({
text: labelText,
dataIndex: index,
x: this._labelX,
y: this._labelY,
dy: "0.6ex",
}, map.params.markerLabelStyle, labelsGroup)
this.label.addClass('jvm-marker jvm-element')
if (isRecentlyCreated) {
this.updateLabelPosition()
}
}
_getStyle() {
let style = {}
if (this._isImage) {
style.initial = { image: this.config.style.initial.image }
} else {
style = this.config.style
}
return style
}
}
export default Marker |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |