Add dedicated Faktiska map production workflow
This commit is contained in:
@@ -10,11 +10,11 @@ import { CityData, drawOnMap } from "./canvasDraw";
|
||||
import { IconInputs } from "../weatherIcons/IconInputs";
|
||||
import { download } from '../../helpers/download'
|
||||
|
||||
export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[] }> = ({ type, data }) => {
|
||||
export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[], mode?: "temperature" | "faktiska" }> = ({ type, data, mode = "temperature" }) => {
|
||||
const [getCanvas, setCanvas] = createSignal<HTMLCanvasElement>();
|
||||
const [getImg, setImg] = createSignal(new Image());
|
||||
const weatherIconsSingal = createSignal<{[key: string]: string;}>({});
|
||||
const [getWeatherIcons] = weatherIconsSingal;
|
||||
const weatherIconsSignal = createSignal<{[key: string]: string;}>({});
|
||||
const [getWeatherIcons] = weatherIconsSignal;
|
||||
const [getTitle, setTitle] = createSignal("");
|
||||
const [getSource, setSource] = createSignal("");
|
||||
|
||||
@@ -90,15 +90,16 @@ export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[
|
||||
return (
|
||||
<div class="mapWorkspace">
|
||||
<div class="mapToolbar"><div><strong>Map preview</strong><span>{props.width} × {props.height} px export</span></div><button class="primary" onClick={downloadPng}>Download PNG</button></div>
|
||||
<details class="broadcastControls">
|
||||
<details class="broadcastControls" open>
|
||||
<summary><span><strong>Broadcast overlay controls</strong><small>Optional manual wind and weather-symbol overrides</small></span></summary>
|
||||
<p class="controlHelp">These settings do not change the queried city values. Use them only when preparing a finished broadcast graphic.</p>
|
||||
<div class="overlayFields">
|
||||
<label><span>Title</span><input type="text" placeholder="19. APRĪĻA GAISA TEMPERATŪRAS REKORDI" value={getTitle()} onInput={e => setTitle(e.target.value)} /></label>
|
||||
<label><span>Source</span><input type="text" placeholder="LVĢMC" value={getSource()} onInput={e => setSource(e.target.value)} /></label>
|
||||
</div>
|
||||
<div class="grid-1-2">
|
||||
<div>
|
||||
<div class="mapControlSections">
|
||||
<section class="valueControls">
|
||||
<strong>Value and wind settings</strong>
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
@@ -110,8 +111,8 @@ export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[
|
||||
</label>
|
||||
</div>
|
||||
{ props.showWind && <WindInputs signals={windSignals} /> }
|
||||
</div>
|
||||
<div><IconInputs weatherIconsSingal={weatherIconsSingal} /></div>
|
||||
</section>
|
||||
{mode === "faktiska" && <IconInputs cities={data().map(([city]) => city)} weatherIconsSignal={weatherIconsSignal} />}
|
||||
</div>
|
||||
</details>
|
||||
<div class="canvasFrame">
|
||||
|
||||
Reference in New Issue
Block a user