Reduce CoordinatesControl layout shifts

This commit is contained in:
James Lyne 2021-08-31 15:02:14 +01:00
parent a689b227c7
commit 9fd53d754e

View File

@ -54,7 +54,7 @@ export class CoordinatesControl extends Control {
onAdd(map: Map) { onAdd(map: Map) {
const container = DomUtil.create('div', 'leaflet-control-coordinates'); const container = DomUtil.create('div', 'leaflet-control-coordinates');
this._coordsContainer.textContent = this.options.showY ? '-----, ----- , -----' : '-----, -----'; this._coordsContainer.textContent = this.options.showY ? '-----, ---, -----' : '-----, -----';
this._coordsContainer.dataset.label = this.options.label; this._coordsContainer.dataset.label = this.options.label;
container.appendChild(this._coordsContainer); container.appendChild(this._coordsContainer);
@ -123,7 +123,7 @@ export class CoordinatesControl extends Control {
if(!this._location) { if(!this._location) {
if (this.options.showY) { if (this.options.showY) {
this._coordsContainer.textContent = '-----, ----- , -----'; this._coordsContainer.textContent = '-----, ---, -----';
} else { } else {
this._coordsContainer.textContent = '-----, -----'; this._coordsContainer.textContent = '-----, -----';
} }