Formatting
This commit is contained in:
@@ -155,9 +155,6 @@ export default class MapComponent extends Component {
|
||||
`;
|
||||
element.appendChild(this.crosshairElement);
|
||||
|
||||
|
||||
|
||||
|
||||
// Geolocation Pulse Overlay
|
||||
this.locationOverlayElement = document.createElement('div');
|
||||
this.locationOverlayElement.className = 'search-pulse blue';
|
||||
@@ -311,7 +308,7 @@ export default class MapComponent extends Component {
|
||||
};
|
||||
|
||||
const startLocating = () => {
|
||||
console.debug('Getting current geolocation...')
|
||||
console.debug('Getting current geolocation...');
|
||||
// 1. Clear any previous session
|
||||
stopLocating();
|
||||
|
||||
@@ -374,11 +371,15 @@ export default class MapComponent extends Component {
|
||||
if (!this.mapInstance) return;
|
||||
|
||||
// Remove existing DragPan interactions
|
||||
this.mapInstance.getInteractions().getArray().slice().forEach((interaction) => {
|
||||
if (interaction instanceof DragPan) {
|
||||
this.mapInstance.removeInteraction(interaction);
|
||||
}
|
||||
});
|
||||
this.mapInstance
|
||||
.getInteractions()
|
||||
.getArray()
|
||||
.slice()
|
||||
.forEach((interaction) => {
|
||||
if (interaction instanceof DragPan) {
|
||||
this.mapInstance.removeInteraction(interaction);
|
||||
}
|
||||
});
|
||||
|
||||
// Add new DragPan with current setting
|
||||
const kinetic = this.settings.mapKinetic
|
||||
@@ -652,10 +653,15 @@ export default class MapComponent extends Component {
|
||||
const mapRect = this.mapInstance.getTargetElement().getBoundingClientRect();
|
||||
const crosshairRect = this.crosshairElement.getBoundingClientRect();
|
||||
|
||||
const centerX = crosshairRect.left + crosshairRect.width / 2 - mapRect.left;
|
||||
const centerY = crosshairRect.top + crosshairRect.height / 2 - mapRect.top;
|
||||
const centerX =
|
||||
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 lat = parseFloat(center[1].toFixed(6));
|
||||
|
||||
@@ -21,11 +21,7 @@ export default class PlaceDetails extends Component {
|
||||
}
|
||||
|
||||
get name() {
|
||||
return (
|
||||
this.place.title ||
|
||||
getLocalizedName(this.tags) ||
|
||||
'Unnamed Place'
|
||||
);
|
||||
return this.place.title || getLocalizedName(this.tags) || 'Unnamed Place';
|
||||
}
|
||||
|
||||
@action
|
||||
@@ -274,7 +270,11 @@ export default class PlaceDetails extends Component {
|
||||
<p class="content-with-icon">
|
||||
<Icon @name="map" />
|
||||
<span>
|
||||
<a href={{this.gmapsUrl}} target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
href={{this.gmapsUrl}}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Google Maps
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -17,8 +17,8 @@ export default class ApplicationComponent extends Component {
|
||||
@tracked isSettingsOpen = false;
|
||||
|
||||
get isSidebarOpen() {
|
||||
// We consider the sidebar "open" if we are in search or place routes.
|
||||
// This helps the map know if it should shift the center or adjust view.
|
||||
// We consider the sidebar "open" if we are in search or place routes.
|
||||
// This helps the map know if it should shift the center or adjust view.
|
||||
return (
|
||||
this.router.currentRouteName === 'place' ||
|
||||
this.router.currentRouteName === 'place.new' ||
|
||||
@@ -48,12 +48,12 @@ export default class ApplicationComponent extends Component {
|
||||
if (this.isSettingsOpen) {
|
||||
this.closeSettings();
|
||||
} else if (this.router.currentRouteName === 'search') {
|
||||
this.router.transitionTo('index');
|
||||
this.router.transitionTo('index');
|
||||
} else if (this.router.currentRouteName === 'place') {
|
||||
// If in place route, decide if we want to go back to search or index
|
||||
// For now, let's go to index or maybe back to search if search params exist?
|
||||
// Simplest behavior: clear selection
|
||||
this.router.transitionTo('index');
|
||||
// If in place route, decide if we want to go back to search or index
|
||||
// For now, let's go to index or maybe back to search if search params exist?
|
||||
// Simplest behavior: clear selection
|
||||
this.router.transitionTo('index');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user