Formatting

This commit is contained in:
2026-02-20 12:38:57 +04:00
parent 2aa59f9384
commit 2734f08608
3 changed files with 31 additions and 25 deletions

View File

@@ -155,9 +155,6 @@ export default class MapComponent extends Component {
`; `;
element.appendChild(this.crosshairElement); element.appendChild(this.crosshairElement);
// Geolocation Pulse Overlay // Geolocation Pulse Overlay
this.locationOverlayElement = document.createElement('div'); this.locationOverlayElement = document.createElement('div');
this.locationOverlayElement.className = 'search-pulse blue'; this.locationOverlayElement.className = 'search-pulse blue';
@@ -311,7 +308,7 @@ export default class MapComponent extends Component {
}; };
const startLocating = () => { const startLocating = () => {
console.debug('Getting current geolocation...') console.debug('Getting current geolocation...');
// 1. Clear any previous session // 1. Clear any previous session
stopLocating(); stopLocating();
@@ -374,7 +371,11 @@ export default class MapComponent extends Component {
if (!this.mapInstance) return; if (!this.mapInstance) return;
// Remove existing DragPan interactions // Remove existing DragPan interactions
this.mapInstance.getInteractions().getArray().slice().forEach((interaction) => { this.mapInstance
.getInteractions()
.getArray()
.slice()
.forEach((interaction) => {
if (interaction instanceof DragPan) { if (interaction instanceof DragPan) {
this.mapInstance.removeInteraction(interaction); this.mapInstance.removeInteraction(interaction);
} }
@@ -652,10 +653,15 @@ export default class MapComponent extends Component {
const mapRect = this.mapInstance.getTargetElement().getBoundingClientRect(); const mapRect = this.mapInstance.getTargetElement().getBoundingClientRect();
const crosshairRect = this.crosshairElement.getBoundingClientRect(); const crosshairRect = this.crosshairElement.getBoundingClientRect();
const centerX = crosshairRect.left + crosshairRect.width / 2 - mapRect.left; const centerX =
const centerY = crosshairRect.top + crosshairRect.height / 2 - mapRect.top; crosshairRect.left + crosshairRect.width / 2 - mapRect.left;
const centerY =
crosshairRect.top + crosshairRect.height / 2 - mapRect.top;
const coordinate = this.mapInstance.getCoordinateFromPixel([centerX, centerY]); const coordinate = this.mapInstance.getCoordinateFromPixel([
centerX,
centerY,
]);
const center = toLonLat(coordinate); const center = toLonLat(coordinate);
const lat = parseFloat(center[1].toFixed(6)); const lat = parseFloat(center[1].toFixed(6));

View File

@@ -21,11 +21,7 @@ export default class PlaceDetails extends Component {
} }
get name() { get name() {
return ( return this.place.title || getLocalizedName(this.tags) || 'Unnamed Place';
this.place.title ||
getLocalizedName(this.tags) ||
'Unnamed Place'
);
} }
@action @action
@@ -274,7 +270,11 @@ export default class PlaceDetails extends Component {
<p class="content-with-icon"> <p class="content-with-icon">
<Icon @name="map" /> <Icon @name="map" />
<span> <span>
<a href={{this.gmapsUrl}} target="_blank" rel="noopener noreferrer"> <a
href={{this.gmapsUrl}}
target="_blank"
rel="noopener noreferrer"
>
Google Maps Google Maps
</a> </a>
</span> </span>