forked from MapComplete/MapComplete
selected_element layer which highlights the selected element
This commit is contained in:
parent
e8ff43312f
commit
42bd301389
13 changed files with 146 additions and 32 deletions
|
@ -5,7 +5,7 @@ import Loc from "../../Models/Loc"
|
|||
import BaseLayer from "../../Models/BaseLayer"
|
||||
import AvailableBaseLayers from "../../Logic/Actors/AvailableBaseLayers"
|
||||
import * as L from "leaflet"
|
||||
import { Map } from "leaflet"
|
||||
import {LeafletMouseEvent, Map} from "leaflet"
|
||||
import Minimap, { MinimapObj, MinimapOptions } from "./Minimap"
|
||||
import { BBox } from "../../Logic/BBox"
|
||||
import "leaflet-polylineoffset"
|
||||
|
@ -316,8 +316,10 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
|||
|
||||
if (this._options.lastClickLocation) {
|
||||
const lastClickLocation = this._options.lastClickLocation
|
||||
map.on("click", function (e) {
|
||||
// @ts-ignore
|
||||
map.on("click", function (e: LeafletMouseEvent) {
|
||||
if(e.originalEvent["dismissed"] ){
|
||||
return
|
||||
}
|
||||
lastClickLocation?.setData({ lat: e.latlng.lat, lon: e.latlng.lng })
|
||||
})
|
||||
|
||||
|
|
|
@ -71,18 +71,22 @@ export default class ScrollableFullScreen {
|
|||
self.Activate()
|
||||
} else {
|
||||
// Some cleanup...
|
||||
ScrollableFullScreen.collapse()
|
||||
|
||||
const fs = document.getElementById("fullscreen")
|
||||
if (fs !== null) {
|
||||
ScrollableFullScreen.empty.AttachTo("fullscreen")
|
||||
fs.classList.add("hidden")
|
||||
}
|
||||
|
||||
ScrollableFullScreen._currentlyOpen?.isShown?.setData(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public static collapse(){
|
||||
const fs = document.getElementById("fullscreen")
|
||||
if (fs !== null) {
|
||||
ScrollableFullScreen.empty.AttachTo("fullscreen")
|
||||
fs.classList.add("hidden")
|
||||
}
|
||||
|
||||
ScrollableFullScreen._currentlyOpen?.isShown?.setData(false)
|
||||
}
|
||||
|
||||
Destroy() {
|
||||
this._fullscreencomponent.Destroy()
|
||||
}
|
||||
|
@ -99,6 +103,7 @@ export default class ScrollableFullScreen {
|
|||
fs.classList.remove("hidden")
|
||||
}
|
||||
|
||||
|
||||
private BuildComponent(title: BaseUIElement, content: BaseUIElement): BaseUIElement {
|
||||
const returnToTheMap = new Combine([
|
||||
Svg.back_svg().SetClass("block md:hidden w-12 h-12 p-2 svg-foreground"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue