forked from MapComplete/MapComplete
More refactoring
This commit is contained in:
parent
5d0fe31c41
commit
41e6a2c760
147 changed files with 1540 additions and 1797 deletions
|
@ -43,7 +43,7 @@ export class MapLibreAdaptor implements MapProperties {
|
|||
*/
|
||||
private _currentRasterLayer: string
|
||||
|
||||
constructor(maplibreMap: Store<MLMap>, state?: Partial<Omit<MapProperties, "bounds">>) {
|
||||
constructor(maplibreMap: Store<MLMap>, state?: Partial<MapProperties>) {
|
||||
this._maplibreMap = maplibreMap
|
||||
|
||||
this.location = state?.location ?? new UIEventSource({ lon: 0, lat: 0 })
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
export let map: Writable<MaplibreMap>
|
||||
|
||||
export let attribution = true
|
||||
let center = {};
|
||||
|
||||
onMount(() => {
|
||||
|
@ -28,6 +29,9 @@
|
|||
<main>
|
||||
<Map bind:center={center}
|
||||
bind:map={$map}
|
||||
{attribution}
|
||||
css="./maplibre-gl.css"
|
||||
|
||||
id="map" location={{lng: 0, lat: 0, zoom: 0}} maxzoom=24 style={styleUrl} />
|
||||
</main>
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class PointRenderingLayer {
|
|||
store = new ImmutableStore(<OsmTags>feature.properties)
|
||||
}
|
||||
const { html, iconAnchor } = this._config.RenderIcon(store, true)
|
||||
html.SetClass("marker")
|
||||
html.SetClass("marker cursor-pointer")
|
||||
const el = html.ConstructElement()
|
||||
|
||||
if (this._onClick) {
|
||||
|
@ -244,7 +244,7 @@ class LineRenderingLayer {
|
|||
},
|
||||
})
|
||||
|
||||
this._visibility.addCallbackAndRunD((visible) => {
|
||||
this._visibility?.addCallbackAndRunD((visible) => {
|
||||
map.setLayoutProperty(linelayer, "visibility", visible ? "visible" : "none")
|
||||
map.setLayoutProperty(polylayer, "visibility", visible ? "visible" : "none")
|
||||
})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import FeatureSource from "../../Logic/FeatureSource/FeatureSource"
|
||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { OsmTags } from "../../Models/OsmFeature"
|
||||
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
||||
import { Feature } from "geojson"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue