jmapcloud-ng-core-types 0.4.2 → 0.4.6

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
@@ -724,8 +724,8 @@ export interface JMapService {
724
724
  getRasterLayerInitialTransparency(layerId: JId): number
725
725
  resetRasterLayerTransparency(layerId: JId): number
726
726
  setRasterLayerTransparency(layerId: JId, transparency: number): void
727
- applyCurrentPixelRatio(): Promise<void>
728
- isPixelRatioCurrentlyValid(pixelRatio: number): boolean
727
+ setPixelRatio(pixelRatio: number): boolean
728
+ getPixelRatio(): number
729
729
  }
730
730
 
731
731
  export interface JMapBasemapService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "0.4.2",
3
+ "version": "0.4.6",
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
@@ -4079,38 +4079,31 @@ declare namespace JMap {
4079
4079
  function setRasterLayerTransparency(layerId: JId, transparency: number): void
4080
4080
 
4081
4081
  /**
4082
- * ***JMap.Map.applyCurrentPixelRatio***
4082
+ * ***JMap.Map.setPixelRatio***
4083
4083
  *
4084
- * Forces the map to redraw using the current device pixel ratio in usage.
4084
+ * This is a technical method that you should not have to use.
4085
4085
  *
4086
- * Rejects if the current `device pixel ratio/map size` combination is invalid .
4086
+ * Will try to set the map's pixel ratio to the passed value. Note that the pixel ratio may not be applied exactly because of the map's drawing canvas size limitations.
4087
4087
  *
4088
- * This is a technical method that you should never have to use.
4088
+ * The method will return:
4089
4089
  *
4090
- * @example ```ts
4090
+ * * false if the passed pixel ratio is the same as the current map's pixel ratio
4091
+ * * false if the applied pixel ratio is not successful (i.e. if the map's canvas size has not changed with the new pixel ratio)
4092
+ * * true if the pixel ratio application is successful or partially successful (i.e. if the map's canvas size has changed)
4091
4093
  *
4092
- * JMap.Map.applyCurrentPixelRatio()
4093
- * .then(()=>console.log("Pixel ratio has been applied"))
4094
- * .catch(error=>console.log("An error occured while applying the pixel ratio:" , error))
4095
- * ```
4094
+ * @param pixelRatio
4096
4095
  */
4097
- function applyCurrentPixelRatio(): Promise<void>
4096
+ function setPixelRatio(pixelRatio: number): boolean
4098
4097
 
4099
4098
  /**
4100
- * ***JMap.Map.isPixelRatioCurrentlyValid***
4099
+ * ***JMap.Map.getPixelRatio***
4101
4100
  *
4102
- * Returns true if the `pixel ratio/map size` combination is currently valid, false otherwise.
4103
- * @throws Error if pixelRatio is not a number
4104
- * @param pixelRatio The pixel ratio to test
4105
- * @example ```ts
4101
+ * This is a technical method that you should not have to use.
4102
+ *
4103
+ * Returns the map's current pixel ratio. Note that this pixel ratio is not garanteed to be the exact pixel ratio applied to the map, because of the map's drawing canvas size limitations.
4106
4104
  *
4107
- * JMap.Map.isPixelRatioCurrentlyValid(2)
4108
- * // true
4109
- * JMap.Map.isPixelRatioCurrentlyValid(9999)
4110
- * // false
4111
- * ```
4112
4105
  */
4113
- function isPixelRatioCurrentlyValid(pixelRatio: number): boolean
4106
+ function getPixelRatio(): number
4114
4107
 
4115
4108
  /**
4116
4109
  * **JMap.Map.resetRasterLayerTransparency**