map-ol-utils 0.0.20 → 0.0.21

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/dist/index.cjs CHANGED
@@ -119,15 +119,18 @@ var getCapabilities = (url) => {
119
119
  }
120
120
  });
121
121
  };
122
- var createWmtsLayer = (serverUrl) => (layerName) => __async(void 0, null, function* () {
122
+ var createWmtsLayer = (serverUrl) => (config) => __async(void 0, null, function* () {
123
+ const { style, format, version, layerName, matrixSet } = config;
123
124
  const [workspace, datastore] = layerName.split(":");
124
125
  const capabilitiesUrl = `${serverUrl}/${workspace}/${datastore}/gwc/service/wmts?request=GetCapabilities`;
125
126
  return new Promise((resolve, reject) => {
126
127
  getCapabilities(capabilitiesUrl).then((data) => {
127
128
  const options = (0, import_WMTS.optionsFromCapabilities)(data, {
129
+ Style: style || "",
128
130
  layer: datastore,
129
- format: "image/png",
130
- matrixSet: "EPSG:4326"
131
+ version: version || "1.1.0",
132
+ format: format || "image/png",
133
+ matrixSet: matrixSet || "EPSG:4326"
131
134
  });
132
135
  console.log(options);
133
136
  if (options) {
package/dist/index.d.cts CHANGED
@@ -73,10 +73,17 @@ type MassMarkersStyleOptions = {
73
73
  size: [number, number];
74
74
  anchor?: [number, number];
75
75
  };
76
+ type WmtsSourceOptions = {
77
+ style?: string;
78
+ format?: string;
79
+ version?: string;
80
+ layerName: string;
81
+ matrixSet?: string;
82
+ };
76
83
 
77
84
  declare const emitter: Emitter<Record<EventType, any>>;
78
85
 
79
- declare const createWmtsLayer: (serverUrl: string) => (layerName: string) => Promise<TileLayer>;
86
+ declare const createWmtsLayer: (serverUrl: string) => (config: WmtsSourceOptions) => Promise<TileLayer>;
80
87
 
81
88
  /**
82
89
  * 创建杭州规自地图
@@ -158,4 +165,4 @@ declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[
158
165
  */
159
166
  declare const updateMarksLayersByStatus: (checkedStatusList?: any[]) => void;
160
167
 
161
- export { type CustomMap, type GetImgUrl, type GetImgUrlFn, type IconConfig, type LayerConfig, type LineConfig, type MassData, type MassMarkersStyleOptions, type VectorConfig, activeMarkerByUid, addMassMarksLayer, buildMassMarksStyles, createAnimationMarker, createBaseLayer, createGeoJsonLayer, createMapInstance, createMapWorldLayer, createMassMarksLayer, createSelectByLayer, createVectorFaceLayer, createVectorLineLayer, createWmtsLayer, disposeMap, emitter, getMapInstance, instance, removeAllLayers, resetActiveMarker, resetActiveVector, resetMap, resetZoomAndCenter, updateMarksLayersByStatus };
168
+ export { type CustomMap, type GetImgUrl, type GetImgUrlFn, type IconConfig, type LayerConfig, type LineConfig, type MassData, type MassMarkersStyleOptions, type VectorConfig, type WmtsSourceOptions, activeMarkerByUid, addMassMarksLayer, buildMassMarksStyles, createAnimationMarker, createBaseLayer, createGeoJsonLayer, createMapInstance, createMapWorldLayer, createMassMarksLayer, createSelectByLayer, createVectorFaceLayer, createVectorLineLayer, createWmtsLayer, disposeMap, emitter, getMapInstance, instance, removeAllLayers, resetActiveMarker, resetActiveVector, resetMap, resetZoomAndCenter, updateMarksLayersByStatus };
package/dist/index.d.ts CHANGED
@@ -73,10 +73,17 @@ type MassMarkersStyleOptions = {
73
73
  size: [number, number];
74
74
  anchor?: [number, number];
75
75
  };
76
+ type WmtsSourceOptions = {
77
+ style?: string;
78
+ format?: string;
79
+ version?: string;
80
+ layerName: string;
81
+ matrixSet?: string;
82
+ };
76
83
 
77
84
  declare const emitter: Emitter<Record<EventType, any>>;
78
85
 
79
- declare const createWmtsLayer: (serverUrl: string) => (layerName: string) => Promise<TileLayer>;
86
+ declare const createWmtsLayer: (serverUrl: string) => (config: WmtsSourceOptions) => Promise<TileLayer>;
80
87
 
81
88
  /**
82
89
  * 创建杭州规自地图
@@ -158,4 +165,4 @@ declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[
158
165
  */
159
166
  declare const updateMarksLayersByStatus: (checkedStatusList?: any[]) => void;
160
167
 
161
- export { type CustomMap, type GetImgUrl, type GetImgUrlFn, type IconConfig, type LayerConfig, type LineConfig, type MassData, type MassMarkersStyleOptions, type VectorConfig, activeMarkerByUid, addMassMarksLayer, buildMassMarksStyles, createAnimationMarker, createBaseLayer, createGeoJsonLayer, createMapInstance, createMapWorldLayer, createMassMarksLayer, createSelectByLayer, createVectorFaceLayer, createVectorLineLayer, createWmtsLayer, disposeMap, emitter, getMapInstance, instance, removeAllLayers, resetActiveMarker, resetActiveVector, resetMap, resetZoomAndCenter, updateMarksLayersByStatus };
168
+ export { type CustomMap, type GetImgUrl, type GetImgUrlFn, type IconConfig, type LayerConfig, type LineConfig, type MassData, type MassMarkersStyleOptions, type VectorConfig, type WmtsSourceOptions, activeMarkerByUid, addMassMarksLayer, buildMassMarksStyles, createAnimationMarker, createBaseLayer, createGeoJsonLayer, createMapInstance, createMapWorldLayer, createMassMarksLayer, createSelectByLayer, createVectorFaceLayer, createVectorLineLayer, createWmtsLayer, disposeMap, emitter, getMapInstance, instance, removeAllLayers, resetActiveMarker, resetActiveVector, resetMap, resetZoomAndCenter, updateMarksLayersByStatus };
package/dist/index.js CHANGED
@@ -64,15 +64,18 @@ var getCapabilities = (url) => {
64
64
  }
65
65
  });
66
66
  };
67
- var createWmtsLayer = (serverUrl) => (layerName) => __async(void 0, null, function* () {
67
+ var createWmtsLayer = (serverUrl) => (config) => __async(void 0, null, function* () {
68
+ const { style, format, version, layerName, matrixSet } = config;
68
69
  const [workspace, datastore] = layerName.split(":");
69
70
  const capabilitiesUrl = `${serverUrl}/${workspace}/${datastore}/gwc/service/wmts?request=GetCapabilities`;
70
71
  return new Promise((resolve, reject) => {
71
72
  getCapabilities(capabilitiesUrl).then((data) => {
72
73
  const options = optionsFromCapabilities(data, {
74
+ Style: style || "",
73
75
  layer: datastore,
74
- format: "image/png",
75
- matrixSet: "EPSG:4326"
76
+ version: version || "1.1.0",
77
+ format: format || "image/png",
78
+ matrixSet: matrixSet || "EPSG:4326"
76
79
  });
77
80
  console.log(options);
78
81
  if (options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "map-ol-utils",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "description": "Openlayers utils library",
6
6
  "files": [