diff --git a/Logic/GeoOperations.ts b/Logic/GeoOperations.ts index 86bc694c3..9c4140d89 100644 --- a/Logic/GeoOperations.ts +++ b/Logic/GeoOperations.ts @@ -14,6 +14,12 @@ export class GeoOperations { return newFeature; } + + static centerpointCoordinates(feature: any){ + const coordinates = turf.center(feature).geometry.coordinates; + coordinates.reverse(); + return coordinates; + } static featureIsContainedInAny(feature: any, shouldNotContain: any[], diff --git a/UI/Image/Attribution.ts b/UI/Image/Attribution.ts index 37180590b..8f0745697 100644 --- a/UI/Image/Attribution.ts +++ b/UI/Image/Attribution.ts @@ -12,7 +12,7 @@ export default class Attribution extends Combine { Translations.W((license ?? "") === "undefined" ? "CC0" : (license ?? "")) ]).SetClass("flex flex-col") ]); - this.SetClass("flex flex-row bg-black text-white text-sm absolute bottom-0 left-0 p-0.5 rounded"); + this.SetClass("flex flex-row bg-black text-white text-sm absolute bottom-0 left-0 p-0.5 pl-5 pr-3 rounded-lg"); } } \ No newline at end of file diff --git a/UI/Image/MapillaryImage.ts b/UI/Image/MapillaryImage.ts index 2c83f09e8..1df5c3ecc 100644 --- a/UI/Image/MapillaryImage.ts +++ b/UI/Image/MapillaryImage.ts @@ -54,7 +54,6 @@ export class MapillaryImage extends UIElement { return new Combine([ image, new Attribution(meta.artist, meta.license, Svg.mapillary_svg()) - ]).SetClass("relative block").Render(); } diff --git a/UI/ShowDataLayer.ts b/UI/ShowDataLayer.ts index 7aaa46832..a3a405354 100644 --- a/UI/ShowDataLayer.ts +++ b/UI/ShowDataLayer.ts @@ -10,6 +10,7 @@ import LazyElement from "./Base/LazyElement"; import FeatureInfoBox from "./Popup/FeatureInfoBox"; import LayoutConfig from "../Customizations/JSON/LayoutConfig"; import ScrollableFullScreen from "./Base/ScrollableFullScreen"; +import {GeoOperations} from "../Logic/GeoOperations"; export default class ShowDataLayer { @@ -53,14 +54,10 @@ export default class ShowDataLayer { } const allFeats = features.data.map(ff => ff.feature); - console.log("AllFeats contain ", allFeats.length) geoLayer = self.CreateGeojsonLayer(); - let i = 0; for (const feat of allFeats) { - const key = feat.geometry.type + feat.properties.id + feat.layer; // @ts-ignore geoLayer.addData(feat); - i++; } if (layoutToUse.data.clustering.minNeededElements <= allFeats.length) { // Activate clustering if it wasn't already activated @@ -68,11 +65,11 @@ export default class ShowDataLayer { cluster = cl.markerClusterGroup({disableClusteringAtZoom: layoutToUse.data.clustering.maxZoom}); cluster.addLayer(geoLayer); mp.addLayer(cluster); - console.log("Added cluster", i) } else { mp.addLayer(geoLayer) - console.log("Added geoLayer", i) } + + State.state.selectedElement.ping(); } features.addCallback(() => update()); @@ -87,7 +84,7 @@ export default class ShowDataLayer { const layer = this._layerDict[feature._matching_layer_id]; return layer.GenerateLeafletStyle(tagsSource, layer._showOnPopup !== undefined); } - + private pointToLayer(feature, latLng): L.Layer { // Leaflet cannot handle geojson points natively // We have to convert them to the appropriate icon @@ -125,8 +122,6 @@ export default class ShowDataLayer { closeButton: false }, leafletLayer); - let isOpen = false; - const tags = State.state.allElements.getEventSourceFor(feature); const uiElement = new LazyElement(() => FeatureInfoBox.construct(tags, layer, () => { @@ -138,14 +133,7 @@ export default class ShowDataLayer { "