SXXXXXXX_FlightMonitor/flightmonitor/map/map_constants.py
2025-05-30 09:42:05 +02:00

89 lines
3.4 KiB
Python

# flightmonitor/map/map_constants.py
"""
Constants related to map drawing, appearance, and behavior.
"""
from typing import Optional, Tuple
# --- Map Drawing Colors and Styles ---
# Colors for drawing boundaries on the map.
DEM_BOUNDARY_COLOR: str = "red"
DEM_BOUNDARY_THICKNESS_PX: int = 3
AREA_BOUNDARY_COLOR: str = "blue"
AREA_BOUNDARY_THICKNESS_PX: int = 2
# Colors for text labels drawn on tiles (e.g., DEM tile names).
TILE_TEXT_COLOR: str = "white"
# Use RGBA for transparency in background if supported by PIL/ImageDraw
TILE_TEXT_BG_COLOR: str = "rgba(0, 0, 0, 150)" # Semi-transparent black background
# --- Map Labeling Constants ---
# Base font size for map tile labels and the corresponding zoom level.
# Font size will be scaled based on the current map zoom relative to this base zoom.
DEM_TILE_LABEL_BASE_FONT_SIZE: int = 12
DEM_TILE_LABEL_BASE_ZOOM: int = 10
# Optional: Default font path for drawing text.
# If None, ImageFont.load_default() will be used as the primary font source.
# If a path is provided, MapCanvasManager/map_drawing might attempt to load
# a TrueType font from this path, falling back to default if it fails.
# Example: DEFAULT_LABEL_FONT_PATH = "/path/to/your/font.ttf"
DEFAULT_LABEL_FONT_PATH: Optional[str] = None
# --- Map Behavior Constants ---
# Default zoom level when the map is initialized or reset if no BBox is set.
DEFAULT_INITIAL_ZOOM: int = 7
# Minimum and maximum allowed zoom levels for interactive pan/zoom.
MIN_ZOOM_LEVEL: int = 0
# Note: Max zoom is often determined by the map tile service,
# this provides a fallback/hard limit if service info isn't available.
DEFAULT_MAX_ZOOM_FALLBACK: int = 19
# --- Placeholders and Fallbacks ---
# Default color for placeholder tile images when a tile cannot be loaded.
DEFAULT_PLACEHOLDER_COLOR_RGB: Tuple[int, int, int] = (220, 220, 220) # Light grey
# MODIFIED: Added constant for Tkinter canvas background color for placeholders.
# WHY: Needed by MapCanvasManager to set the canvas background when displaying placeholder text.
# HOW: Added the new constant definition.
DEFAULT_PLACEHOLDER_COLOR_RGB_TK: str = "gray85" # Tkinter color string for canvas background
# --- Map Information Panel Formatting ---
# Number of decimal places to display for coordinates in the info panel.
COORDINATE_DECIMAL_PLACES: int = 5
MAP_SIZE_KM_DECIMAL_PLACES: int = 1 # Number of decimal places for map size in km.
# Define standard degree, minute, second symbols for DMS formatting
DMS_DEGREE_SYMBOL: str = "°"
DMS_MINUTE_SYMBOL: str = "'"
DMS_SECOND_SYMBOL: str = "''"
#MODIFIED: Paletta colori
#WHY: Paletta ampliata
#HOW: Ampliata la lista dei colori
TRACK_COLOR_PALETTE = [
"#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF", "#00FFFF",
"#800000", "#008000", "#000080", "#808000", "#800080", "#008080",
"#C0C0C0", "#400000", "#004000", "#000040", "#404000", "#400040",
"#004040", "#202020", "#FF8000", "#80FF00", "#00FF80", "#8000FF",
"#FF0080", "#0080FF", "#808080", "#A0522D", "#D2691E", "#DAA520",
"#BDB76B", "#8FBC8F", "#FA8072", "#E9967A", "#F08080", "#CD5C5C",
"#DC143C", "#B22222", "#FF69B4", "#FF1493", "#C71585", "#DB7093",
"#E6E6FA", "#D8BFD8", "#DDA0DD", "#EE82EE", "#9932CC", "#8A2BE2",
"#BA55D3", "#9370DB", "#7B68EE", "#6A5ACD", "#483D8B", "#708090",
"#778899", "#B0C4DE", "#ADD8E6", "#87CEEB", "#87CEFA", "#00BFFF",
"#1E90FF", "#6495ED", "#4682B4", "#0000CD", "#00008B"
]
"""
Palette di 64 colori da utilizzare per le tracce degli aerei
"""