fix: CSP blob: worker fuer MapLibre, MapPin Import, Icon Scale Limits erweitert (v1.0.1)
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
Key,
|
||||
Shield,
|
||||
Building2,
|
||||
MapPin,
|
||||
} from 'lucide-react'
|
||||
import { HoseSettingsDialog } from '@/components/dialogs/hose-settings-dialog'
|
||||
import type { Project, DrawFeature } from '@/app/app/page'
|
||||
|
||||
@@ -718,6 +718,9 @@ export function MapView({
|
||||
if (!m) return
|
||||
setIsMapLoaded(true)
|
||||
|
||||
// Guard: skip if sources already exist (React strict mode double-mount)
|
||||
if (m.getSource('draw-features')) return
|
||||
|
||||
// Drawing features source
|
||||
m.addSource('draw-features', {
|
||||
type: 'geojson',
|
||||
@@ -2028,14 +2031,14 @@ export function MapView({
|
||||
const startW = selectedSymbolRef.current.resizeStartWidth || 1
|
||||
const startScale = selectedSymbolRef.current.resizeStartScale || 1
|
||||
const ratio = width / startW
|
||||
selectedSymbolRef.current.scale = Math.max(0.5, Math.min(5, startScale * ratio))
|
||||
selectedSymbolRef.current.scale = Math.max(0.2, Math.min(10, startScale * ratio))
|
||||
selectedSymbolRef.current.innerEl.style.fontSize = `${baseFontSize * selectedSymbolRef.current.scale}px`
|
||||
} else {
|
||||
// For symbols: resize wrapper
|
||||
selectedSymbolRef.current.wrapperEl.style.width = `${width}px`
|
||||
selectedSymbolRef.current.wrapperEl.style.height = `${height}px`
|
||||
const baseSize = 32
|
||||
selectedSymbolRef.current.scale = Math.max(0.3, Math.min(4, width / baseSize))
|
||||
selectedSymbolRef.current.scale = Math.max(0.1, Math.min(10, width / baseSize))
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user