Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/js/components/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class Region extends BaseComponent {
this._map = map
this.shape = this._createRegion(path, code, style)

let bbox = this.shape.getBBox()
let text = this.getLabelText(code, label)

// If label is passed and render function returns something
if (label && text) {
let bbox = this.shape.getBBox()

let offsets = this.getLabelOffsets(code, label)
this.labelX = bbox.x + bbox.width / 2 + offsets[0]
this.labelY = bbox.y + bbox.height / 2 + offsets[1]
Expand Down