jmapserver-ng-core-types 2.0.7 → 2.0.9

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/all-enums.ts CHANGED
@@ -279,5 +279,6 @@ export const ALL_MAP_RASTER_SCHEME_TYPES: JMAP_RASTER_SCHEME_TYPES[] = [
279
279
  ]
280
280
 
281
281
  export const ALL_JORGANIZATION_EXTERNAL_API_KEY_TYPES: JORGANIZATION_EXTERNAL_API_KEY_TYPES[] = [
282
- JORGANIZATION_EXTERNAL_API_KEY_TYPES.MAPBOX_ACCESS_TOKEN
282
+ JORGANIZATION_EXTERNAL_API_KEY_TYPES.MAPBOX_ACCESS_TOKEN,
283
+ JORGANIZATION_EXTERNAL_API_KEY_TYPES.GOOGLE_MAPS_API_KEY
283
284
  ]
package/index.ts CHANGED
@@ -140,6 +140,7 @@ export interface JPhotoService {
140
140
 
141
141
  export interface JFeatureService {
142
142
  getById(layerId: JId, featureId: JId): Promise<GeoJSON.Feature>
143
+ getByLayerId(layerId: JId, bbox: JBoundaryBox): Promise<GeoJSON.Feature[]>
143
144
  getByIds(layerId: JId, featureIds: JId[]): Promise<GeoJSON.Feature[]>
144
145
  geometryUpdateById(params: JFeatureGeometryUpdateParams): Promise<GeoJSON.Feature>
145
146
  deleteById(layerId: JId, featureId: JId): Promise<GeoJSON.Feature>
@@ -734,6 +735,7 @@ export interface JMapBasemapService {
734
735
  isDisabled(): boolean
735
736
  isActive(): boolean
736
737
  isMapboxId(basemapId: string): boolean
738
+ isGoogleMapsId(basemapId: string): boolean
737
739
  isOSMId(basemapId: string): boolean
738
740
  getActiveId(): string | undefined
739
741
  existsById(basemapId: string): boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapserver-ng-core-types",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "JMap Server specific version of JMap Server NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/public/core.d.ts CHANGED
@@ -469,6 +469,33 @@ declare namespace JMap {
469
469
  */
470
470
  function getById(layerId: JId, featureId: JId): Promise<GeoJSON.Feature>
471
471
 
472
+ /**
473
+ * **JMap.Feature.getByLayerId**
474
+ *
475
+ * Returns the feature (EPSG:4326 projection) for the given layer and bbox.
476
+ *
477
+ * @param layerId the JMap layer id
478
+ * @param bbox the bounding box
479
+ * @throws if layer not found or bbox is invalid
480
+ * @example ```ts
481
+ *
482
+ * // returns the feature of layer id="3" and bbox
483
+ * JMap.Feature.getByLayer(3, {
484
+ * ne: {
485
+ * x: -73.69935286533261,
486
+ * y: 45.51487645603402
487
+ * },
488
+ * sw: {
489
+ * x: -73.78637009135603,
490
+ * y: 45.47581946298703
491
+ * }
492
+ * })
493
+ * .then(features => console.info("Features has been fetched", features))
494
+ * .catch(error => console.error("An error occured", error))
495
+ * ```
496
+ */
497
+ function getByLayerId(layerId: JId, bbox: JBoundaryBox): Promise<GeoJSON.Feature[]>
498
+
472
499
  /**
473
500
  * **JMap.Feature.getByIds**
474
501
  *
@@ -5057,6 +5084,22 @@ declare namespace JMap {
5057
5084
  */
5058
5085
  function isOSMId(basemapId: string): boolean
5059
5086
 
5087
+ /**
5088
+ * ***JMap.Map.Basemap.isGoogleMapsId***
5089
+ *
5090
+ * Returns true if the basemap id is a Google Maps basemap.
5091
+ *
5092
+ * @example ```ts
5093
+ *
5094
+ * // returns true
5095
+ * JMap.Map.Basemap.isGoogleMapsId("google-roadmap")
5096
+ *
5097
+ * // returns false
5098
+ * JMap.Map.Basemap.isGoogleMapsId("mapbox-streets")
5099
+ * ```
5100
+ */
5101
+ function isGoogleMapsId(basemapId: string): boolean
5102
+
5060
5103
  /**
5061
5104
  * ***JMap.Map.Basemap.getActiveId***
5062
5105
  *
@@ -321,6 +321,36 @@ declare interface JCoreMapOptions {
321
321
  */
322
322
  mapboxToken?: string
323
323
 
324
+ /**
325
+ * If a Google Maps API key is set through the JMap Admin interface,
326
+ * the JMap Server NG Core library will use it automatically, nothing else to do for you.
327
+ *
328
+ * The Google Maps API key is used by JMap Server NG in order to display Google basemaps and to use other Google related functionalities.
329
+ *
330
+ * In order to use Google basemaps, you need to enable the Map Tiles API in your Google account. See the {@link https://developers.google.com/maps/documentation/tile/cloud-setup?_gl=1*hgipm1*_up*MQ..*_ga*MTE3OTc5MTI1Ni4xNzEyMzI0Njc4*_ga_NRWSTWS78N*MTcxMjMyNDY3Ny4xLjAuMTcxMjMyNDY3Ny4wLjAuMA.. |documentation} for more details about this
331
+ *
332
+ * If no Google Maps API key is set in JMap Admin, or if you want to use
333
+ * the Google Maps API key of your choice, you have to set the "***googleMapsApiKey***" parameter :
334
+ *
335
+ * ```html
336
+ * <html>
337
+ * ...
338
+ * <body>
339
+ * <script type="text/javascript">
340
+ * window.JMAP_OPTIONS = {
341
+ * ...
342
+ * map: {
343
+ * googleMapsApiKey: "google-maps-api-key"
344
+ * }
345
+ * }
346
+ * </script>
347
+ * ...
348
+ * </body>
349
+ * </html>
350
+ * ```
351
+ */
352
+ googleMapsApiKey?: string
353
+
324
354
  /**
325
355
  * By default the Map Rotation control is not visible.
326
356
  *
@@ -81,5 +81,6 @@ declare interface JJMapPasswordPolicyCompliance {
81
81
 
82
82
  // ALL_JORGANIZATION_EXTERNAL_API_KEY_TYPES in all-enum.ts
83
83
  declare const enum JORGANIZATION_EXTERNAL_API_KEY_TYPES {
84
- MAPBOX_ACCESS_TOKEN = "MAPBOX_ACCESS_TOKEN"
84
+ MAPBOX_ACCESS_TOKEN = "MAPBOX_ACCESS_TOKEN",
85
+ GOOGLE_MAPS_API_KEY = "GOOGLE_MAPS_API_KEY"
85
86
  }