tds-map-methods 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,21 +1,31 @@
1
1
  # tds-map-methods
2
2
 
3
- 可复用的 TDS 地图方法库,支持 ESM 和 CommonJS。
3
+ Reusable TDS/OpenLayers rendering methods for browser applications.
4
4
 
5
- ## 安装
5
+ ## Install
6
6
 
7
7
  ```sh
8
8
  npm install tds-map-methods ol @turf/turf dayjs d3-contour lodash-es
9
9
  ```
10
10
 
11
- ## 使用
11
+ ## Configure and use
12
12
 
13
13
  ```ts
14
- import { initMap, loadLayer, removeLayerById } from "tds-map-methods";
14
+ import { configureMapMethods, initMap, loadLayer } from "tds-map-methods";
15
+
16
+ configureMapMethods({
17
+ serviceBaseUrl: "/server",
18
+ serviceAuthorization: "Basic ...",
19
+ ncssBaseUrl: "/ncss/grid",
20
+ imageSize: 2048,
21
+ typhoonServiceBaseUrl: "/typhoon-server",
22
+ });
15
23
 
16
24
  const map = await initMap("map", { center: [118.8, 32.1], zoom: 5 });
17
25
  loadLayer(map, layerOptions);
18
- removeLayerById(layerOptions.id);
19
26
  ```
20
27
 
21
- 依赖 OpenLayers 浏览器运行环境。方法中的数据地址、鉴权和图像尺寸通过传入的图层配置或宿主应用环境提供。
28
+ The package also exports TDS request helpers, including fetchTdsGet, fetchXMLFromUrl,
29
+ getMenuList, getXmlData, getVariableMinMax, resolveLayerLoadOptions, and typhoon requests.
30
+
31
+ The package does not read host Vite environment variables. Supply service URLs explicitly.