Popup fixes
This commit is contained in:
@@ -180,16 +180,18 @@ function buildStationLayer(lat: number, lon: number, dark: boolean): VectorLayer
|
||||
|
||||
onMounted(async () => {
|
||||
const position = await api.position()
|
||||
const lat = position?.latitude || 0
|
||||
const lon = position?.longitude || 0
|
||||
current.value = {
|
||||
latitude: position?.latitude || 0,
|
||||
longitude: position?.longitude || 0,
|
||||
}
|
||||
|
||||
stationLayer = buildStationLayer(lat, lon, props.dark)
|
||||
stationLayer = buildStationLayer(current.value.latitude, current.value.longitude, props.dark)
|
||||
|
||||
map = new Map({
|
||||
target: mapEl.value!,
|
||||
layers: [buildBaseLayer(props.dark), stationLayer],
|
||||
interactions: defaultInteractions({ altShiftDragRotate: false, pinchRotate: false }),
|
||||
view: new View({ center: fromLonLat([lon, lat]), zoom: 8, maxZoom: 13 }),
|
||||
view: new View({ center: fromLonLat([current.value.longitude, current.value.latitude]), zoom: 8, maxZoom: 13 }),
|
||||
controls: [],
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user