jmapcloud-ng-core-types 1.0.7 → 1.0.8

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/index.ts CHANGED
@@ -709,14 +709,10 @@ export interface JMapService {
709
709
  setMapInfoControlVisibility(isVisible: boolean): void
710
710
  isMapInfoControlExpanded(): boolean
711
711
  setMapInfoControlExpansion(isExpanded: boolean): void
712
- isLayerRendered(layerId: JId): boolean
713
- getLayersVisibilityStatus(): JMapLayersVisibilityStatus
714
- getLayersVisibilityStatusAsArray(): JMapLayerVisibilityStatus[]
715
712
  getMaplibreSupportedJMapLayerIds(): JId[]
716
713
  getMaplibreSupportedJMapLayerIdBefore(layerId: JId): JId | undefined
717
714
  getMaplibreSupportedJMapLayerIdAfter(layerId: JId): JId | undefined
718
715
  refreshLayerById(layerId: JId): void
719
- getRenderedJMapLayerIds(): JId[]
720
716
  getRenderedFeatures(layerId: JId, params?: JLocation | JBoundaryBox | JCircle | JGetRenderedFeaturesParams): Feature[]
721
717
  getSourceFeatures(layerId: JId, params?: JGetSourceFeaturesParams): Feature[]
722
718
  getRenderedFeaturesAttributeValues(
@@ -826,8 +822,8 @@ export interface JMapFilterService {
826
822
  }
827
823
 
828
824
  export interface JProjectionService {
829
- reprojectLocation(location: JLocation, toProjection: string, fromProjection?: string): JLocation
830
- reprojectBoundaryBox(boundaryBox: JBoundaryBox, toProjection: string, fromProjection?: string): JBoundaryBox
825
+ reprojectLocation(location: JLocation, toProjection: string, fromProjection?: string): Promise<JLocation>
826
+ reprojectBoundaryBox(boundaryBox: JBoundaryBox, toProjection: string, fromProjection?: string): Promise<JBoundaryBox>
831
827
  }
832
828
 
833
829
  export interface JProjectService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/public/core.d.ts CHANGED
@@ -1860,20 +1860,16 @@ declare namespace JMap {
1860
1860
  *
1861
1861
  * Returns the extent of the layer in ESPG:4326 coordinates
1862
1862
  *
1863
- * With a JMap Cloud server, a call is made to the server.
1864
- *
1865
- * With a JMap 7 server, no call to server is made, returns the cached extent.
1866
- *
1867
1863
  * @example ```ts
1868
1864
  *
1869
- * // returns the bounding box (JBoundaryBox) of the layer ID 3 in decimal degrees
1865
+ * // returns the bounding box (JBoundaryBox) of the layer ID "5d86a209-3a09-49d9-92f0-dce3c46bb23d" in decimal degrees
1870
1866
  * JMap.Layer
1871
- * .getEPSG4326Extent(3)
1872
- * .then(extent => console.info("Extent of layer id=3", extent))
1867
+ * .getEPSG4326Extent("5d86a209-3a09-49d9-92f0-dce3c46bb23d")
1868
+ * .then(extent => console.info("Extent of layer id=\"5d86a209-3a09-49d9-92f0-dce3c46bb23d\"", extent))
1873
1869
  * .catch(error => console.error(error))
1874
1870
  * ```
1875
1871
  *
1876
- * @throws Error if no layer found for the id
1872
+ * @throws Error if no layer found for the id or if layer is a group
1877
1873
  * @param layerId The JMap layer id
1878
1874
  */
1879
1875
  function getEPSG4326Extent(layerId: JId): Promise<JBoundaryBox | null>
@@ -3177,96 +3173,6 @@ declare namespace JMap {
3177
3173
  */
3178
3174
  function getScaleControlPosition(): JMAP_POSITIONS
3179
3175
 
3180
- /**
3181
- * **JMap.Map.isLayerRendered**
3182
- *
3183
- * Returns true if layer is visible on the map.
3184
- *
3185
- * To be true the layer visibility property has to be true,
3186
- * and the current map scale between the layer min and max scale.
3187
- *
3188
- * @example ```ts
3189
- *
3190
- * // returns true if layer is visible on the map
3191
- * JMap.Map.isLayerRendered(4)
3192
- * ```
3193
- */
3194
- function isLayerRendered(layerId: JId): boolean
3195
-
3196
- /**
3197
- * **JMap.Map.getLayersVisibilityStatus**
3198
- *
3199
- * Returns layers visibility status.
3200
- *
3201
- * The result is a map (= javascript object) where :
3202
- * - the key is the JMap layer id
3203
- * - the value is a JMapLayersVisibilityStatus object
3204
- *
3205
- * A JMapLayersVisibilityStatus object has the following properties :
3206
- * - layerId: the layer id
3207
- * - layerName: the layer name
3208
- * - isRendered: true if 'visibilityProperty', 'parentVisibility',
3209
- * 'scaleVisibility' and 'extentVisibility' are all true
3210
- * - visibilityProperty: user can show or hide a layer
3211
- * - parentVisibility: returns false if one of its group parent(s) has
3212
- * its visibility property equals to false
3213
- * - scaleVisibility: returns false if at the current scale the layer
3214
- * cannot be displayed
3215
- * - extentVisibility: returns false if the extent of the layer is not
3216
- * contains by the current view of the map
3217
- *
3218
- * @example ```ts
3219
- *
3220
- * // returns the visibility status
3221
- * JMap.Map.getLayersVisibilityStatus()
3222
- *
3223
- * // Example of result :
3224
- * {
3225
- * 1: { layerId: 1, layerName: "layer 1", isRendered: true, visibilityProperty: true, parentVisibility: true, scaleVisibility: true, extentVisibility: true }
3226
- * 2: { layerId: 2, layerName: "layer 2", isRendered: false, visibilityProperty: true, parentVisibility: true, scaleVisibility: false, extentVisibility: true }
3227
- * 3: { layerId: 3, layerName: "layer 3", isRendered: false, visibilityProperty: false, parentVisibility: true, scaleVisibility: false, extentVisibility: true }
3228
- * 4: { layerId: 4, layerName: "layer 4", isRendered: false, visibilityProperty: false, parentVisibility: false, scaleVisibility: false, extentVisibility: true }
3229
- * 5: { layerId: 5, layerName: "layer 5", isRendered: false, visibilityProperty: true, parentVisibility: true, scaleVisibility: true, extentVisibility: false }
3230
- * }
3231
- * ```
3232
- */
3233
- function getLayersVisibilityStatus(): JMapLayersVisibilityStatus
3234
-
3235
- /**
3236
- * **JMap.Map.getLayersVisibilityStatusAsArray**
3237
- *
3238
- * Returns layers visibility status as an array of JMapLayersVisibilityStatus object.
3239
- *
3240
- * A JMapLayersVisibilityStatus object has the following properties :
3241
- * - layerId: the layer id
3242
- * - layerName: the layer name
3243
- * - isRendered: true if 'visibilityProperty', 'parentVisibility',
3244
- * 'scaleVisibility' and 'extentVisibility' are all true
3245
- * - visibilityProperty: user can show or hide a layer
3246
- * - parentVisibility: returns false if one of its group parent(s) has
3247
- * its visibility property equals to false
3248
- * - scaleVisibility: returns false if at the current scale the layer
3249
- * cannot be displayed
3250
- * - extentVisibility: returns false if the extent of the layer is not
3251
- * contains by the current view of the map
3252
- *
3253
- * @example ```ts
3254
- *
3255
- * // returns the visibility status as an object array
3256
- * JMap.Map.getLayersVisibilityStatusAsArray()
3257
- *
3258
- * // Example of result :
3259
- * [
3260
- * { layerId: 1, layerName: "layer 1", isRendered: true, visibilityProperty: true, parentVisibility: true, scaleVisibility: true, extentVisibility: true }
3261
- * { layerId: 2, layerName: "layer 2", isRendered: false, visibilityProperty: true, parentVisibility: true, scaleVisibility: false, extentVisibility: true }
3262
- * { layerId: 3, layerName: "layer 3", isRendered: false, visibilityProperty: false, parentVisibility: true, scaleVisibility: false, extentVisibility: true }
3263
- * { layerId: 4, layerName: "layer 4", isRendered: false, visibilityProperty: false, parentVisibility: false, scaleVisibility: false, extentVisibility: true }
3264
- * { layerId: 5, layerName: "layer 5", isRendered: false, visibilityProperty: true, parentVisibility: true, scaleVisibility: true, extentVisibility: false }
3265
- * ]
3266
- * ```
3267
- */
3268
- function getLayersVisibilityStatusAsArray(): JMapLayerVisibilityStatus[]
3269
-
3270
3176
  /**
3271
3177
  * **JMap.Map.getMaplibreSupportedJMapLayerIds**
3272
3178
  *
@@ -3334,23 +3240,6 @@ declare namespace JMap {
3334
3240
  */
3335
3241
  function refreshLayerById(layerId: JId): void
3336
3242
 
3337
- /**
3338
- * **JMap.Map.getRenderedJMapLayerIds**
3339
- *
3340
- * Returns the ids of the layers that are displayed on the map.
3341
- *
3342
- * The Map JS library doesn't support all layer types defined on JMap Server.
3343
- *
3344
- * This function returns all layers ids that are managed by the map.
3345
- *
3346
- * @example ```ts
3347
- *
3348
- * // returns all layer ids that are managed by the map
3349
- * JMap.Map.getRenderedJMapLayerIds()
3350
- * ```
3351
- */
3352
- function getRenderedJMapLayerIds(): JId[]
3353
-
3354
3243
  /**
3355
3244
  * **JMap.Map.getRenderedFeatures**
3356
3245
  *
@@ -5965,7 +5854,7 @@ declare namespace JMap {
5965
5854
  * @example ```ts
5966
5855
  *
5967
5856
  * // returns the location in long/lat
5968
- * const longLatLocation = JMap.Projection.reprojectLocation({
5857
+ * const longLatLocation = await JMap.Projection.reprojectLocation({
5969
5858
  * x: -8251305.053809433,
5970
5859
  * y: 5683448.361086178
5971
5860
  * },
@@ -5975,7 +5864,7 @@ declare namespace JMap {
5975
5864
  * console.log("Long/lat location", longLatLocation)
5976
5865
  * ```
5977
5866
  */
5978
- function reprojectLocation(location: JLocation, toProjection: string, fromProjection?: string): JLocation
5867
+ function reprojectLocation(location: JLocation, toProjection: string, fromProjection?: string): Promise<JLocation>
5979
5868
 
5980
5869
  /**
5981
5870
  * ***JMap.Projection.reprojectBoundaryBox***
@@ -5989,7 +5878,7 @@ declare namespace JMap {
5989
5878
  * @example ```ts
5990
5879
  *
5991
5880
  * // returns the boundary box in long/lat
5992
- * const longLatBbox = JMap.Projection.reprojectBoundaryBox({
5881
+ * const longLatBbox = await JMap.Projection.reprojectBoundaryBox({
5993
5882
  * x: -8251305.053809433,
5994
5883
  * y: 5683448.361086178
5995
5884
  * },
@@ -6003,7 +5892,7 @@ declare namespace JMap {
6003
5892
  boundaryBox: JBoundaryBox,
6004
5893
  toProjection: string,
6005
5894
  fromProjection?: string
6006
- ): JBoundaryBox
5895
+ ): Promise<JBoundaryBox>
6007
5896
  }
6008
5897
 
6009
5898
  /**
@@ -123,20 +123,6 @@ declare type JMapSelection = {
123
123
  [key in JId]: GeoJSON.Feature[]
124
124
  }
125
125
 
126
- declare interface JMapLayerVisibilityStatus {
127
- layerId: JId
128
- layerName: string
129
- isRendered: boolean
130
- visibilityProperty: boolean
131
- parentVisibility: boolean
132
- scaleVisibility: boolean
133
- extentVisibility: boolean
134
- }
135
-
136
- declare type JMapLayersVisibilityStatus = {
137
- [key in JId]: JMapLayerVisibilityStatus
138
- }
139
-
140
126
  declare interface JProjection {
141
127
  code: string
142
128
  name: string