Compare commits

..

2 Commits

Author SHA1 Message Date
b17793af9d 1.17.1
Some checks failed
CI / Lint (push) Successful in 29s
CI / Test (push) Failing after 44s
2026-03-28 15:32:21 +04:00
dc9e0f210a Hide search result markers when result is selected 2026-03-28 15:30:27 +04:00
5 changed files with 31 additions and 4 deletions

View File

@@ -119,6 +119,28 @@ export default class MapComponent extends Component {
const searchResultStyle = (feature) => { const searchResultStyle = (feature) => {
const originalPlace = feature.get('originalPlace'); const originalPlace = feature.get('originalPlace');
// If this place is currently selected, hide the search result marker
// because the main red drop pin will be shown instead.
const selectedPlace = this.mapUi.selectedPlace;
if (selectedPlace) {
const isSameOsmId =
originalPlace.osmId &&
selectedPlace.osmId &&
originalPlace.osmId === selectedPlace.osmId;
const isSameId =
originalPlace.id &&
selectedPlace.id &&
originalPlace.id === selectedPlace.id;
const isSameCoords =
originalPlace.lat === selectedPlace.lat &&
originalPlace.lon === selectedPlace.lon;
if (isSameOsmId || isSameId || isSameCoords) {
return new Style({}); // Empty style makes it invisible
}
}
// Some search results might be just the place object without separate tags // Some search results might be just the place object without separate tags
// If it's a raw place object, it might have osmTags property. // If it's a raw place object, it might have osmTags property.
// Or it might be the tags object itself. // Or it might be the tags object itself.
@@ -599,6 +621,11 @@ export default class MapComponent extends Component {
const selected = this.mapUi.selectedPlace; const selected = this.mapUi.selectedPlace;
const options = this.mapUi.selectionOptions || {}; const options = this.mapUi.selectionOptions || {};
// Force a redraw of the search results layer so it can hide/show the selected pin
if (this.searchResultsSource) {
this.searchResultsSource.changed();
}
if (!this.selectedPinOverlay || !this.selectedPinElement) return; if (!this.selectedPinOverlay || !this.selectedPinElement) return;
// Clear any previous shape // Clear any previous shape

View File

@@ -1,6 +1,6 @@
{ {
"name": "marco", "name": "marco",
"version": "1.17.0", "version": "1.17.1",
"private": true, "private": true,
"description": "Unhosted maps app", "description": "Unhosted maps app",
"repository": { "repository": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -39,7 +39,7 @@
<meta name="msapplication-TileColor" content="#F6E9A6"> <meta name="msapplication-TileColor" content="#F6E9A6">
<meta name="msapplication-TileImage" content="/icons/icon-144.png"> <meta name="msapplication-TileImage" content="/icons/icon-144.png">
<script type="module" crossorigin src="/assets/main-DM7YMuyX.js"></script> <script type="module" crossorigin src="/assets/main-CL6xsaNr.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-OLSOzTKA.css"> <link rel="stylesheet" crossorigin href="/assets/main-OLSOzTKA.css">
</head> </head>
<body> <body>