feat: add WeatherV2 HTTP particle provider
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { File, Paths } from "expo-file-system";
|
||||
import {
|
||||
WeatherV2HttpClient,
|
||||
loadWeatherV2WindIntoRuntime,
|
||||
type LoadWeatherV2WindResult,
|
||||
type WeatherV2BinaryFileStore,
|
||||
} from "@navsea/maplibre-particle-rn";
|
||||
|
||||
const weatherClient = new WeatherV2HttpClient({
|
||||
baseUrl: "https://weather.jpcn.ccwu.cc",
|
||||
});
|
||||
|
||||
const fileStore: WeatherV2BinaryFileStore = {
|
||||
async writeTempFile(fileName, bytes) {
|
||||
const file = new File(Paths.cache, fileName);
|
||||
file.write(bytes);
|
||||
return file.uri;
|
||||
},
|
||||
};
|
||||
|
||||
const frozenTargetTimes = [
|
||||
"2026080700",
|
||||
"2026080706",
|
||||
"2026080712",
|
||||
"2026080718",
|
||||
] as const;
|
||||
|
||||
export async function loadHttpWeatherV2(reactTag: number): Promise<LoadWeatherV2WindResult> {
|
||||
return loadWeatherV2WindIntoRuntime({
|
||||
reactTag,
|
||||
client: weatherClient,
|
||||
fileStore,
|
||||
datasetId: "ecmwf-hres",
|
||||
referenceTime: "2026080600",
|
||||
targetTimes: frozenTargetTimes,
|
||||
weatherColorVisible: true,
|
||||
particleVisible: true,
|
||||
playbackState: "PAUSE",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user