代码拉取完成,页面将自动刷新
同步操作将从 清风/QuickEarth-Free 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>QuickEarth-气象数据渲染引擎</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="./umd/quickearth.umd.min.js"></script>
</head>
<body>
<div id="map" style="position:absolute;top:0px;left:0px;width:100%;height:100%;overflow:hidden"></div>
<script>
QE.init("f17d186a2e692c9f6f2e79e48b270012");
const map = new QE.LMap("map", { crs: L.CRS.EPSG3857, fadeAnimation: false, zoomControl: false }).setView([25.5, 116.5], 7);
const tileLayer = QE.createTileLayer(QE.predefinedImageTiles.windy, { pane: QE.consts.customPanes.topmap.name });
map.addLayer(tileLayer);
const showGridVal = async () => {
const gridOptions = {
xStart: 0,
// xDelta: 0.25,
xDelta: 0.5,
// xSize: 1440,
xSize: 720,
yStart: 90,
// yDelta: -0.25,
yDelta: -0.5,
// ySize: 721
ySize: 361
};
QE.ensureGridDataOptions(gridOptions);
const provider = await QE.GrayImageGridDataProvider.fromURL("http://qecloud.91weather.com/public/demos/data/mqe/GFS0P50_20220411020000_precp_single_33300.mqe", false, {
gridOptions,
scale: 0.1,
offset: 0,
dataType: QE.GridDataType.UInt16,
algo: 1,
autoLoadToMemory: true
});
const style = {
fillColor: "color-precp#res",
fillMode: QE.GridDataGLFillMode.pixel1
};
const layer = new QE.LPixelLayer({
debugShowPerformance: true,
name: "格点降水渐变填色"
}).setDrawOptions(style).setDataSource(provider);
map.addLayer(layer);
const labelLayer = new QE.LGridLabelLayer({
name: "格点填值",
ignoreRetina: false
}).setDrawOptions({
text: {
data: "#decimal?len=1",
// backColor: "rgba(255,255,255,0.2)",
color: "black",
strokeWidth: 1,
visible: (val) => {
return val >= 0.01;
}
//strokeColor: "white",
//strokeWidth: 2
}
}).setDataSource(provider);
map.addLayer(labelLayer);
}
const load = async () => {
await QE.resourceService.loadResourceFromConfigPath("demos/styles/demo.config.json");
showGridVal();
}
load();
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。