jmapcloud-ng-types 1.0.1001 → 1.1.0

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/public/app.d.ts CHANGED
@@ -16,8 +16,8 @@ declare namespace JMap {
16
16
  *
17
17
  * Returns the application build version.
18
18
  *
19
- * @example ```ts
20
- *
19
+ * @example
20
+ * ```ts
21
21
  * // return the build version, for example "1.0.1"
22
22
  * JMap.Application.getVersion()
23
23
  * ```
@@ -31,8 +31,8 @@ declare namespace JMap {
31
31
  *
32
32
  * For the same API version, multiple implementation versions can exist.
33
33
  *
34
- * @example ```ts
35
- *
34
+ * @example
35
+ * ```ts
36
36
  * // return the build version, for example "1.0.1"
37
37
  * JMap.Application.getApiVersion()
38
38
  * ```
@@ -44,8 +44,8 @@ declare namespace JMap {
44
44
  *
45
45
  * Opens JMap Cloud NG's online JS API documentation, in a new tab.
46
46
  *
47
- * @example ```ts
48
- *
47
+ * @example
48
+ * ```ts
49
49
  * // open JMap Cloud NG's online documentation, in a new tab
50
50
  * JMap.Application.openDocumentation()
51
51
  * ```
@@ -57,8 +57,8 @@ declare namespace JMap {
57
57
  *
58
58
  * Opens JMap Cloud NG's online user manual, in a new tab.
59
59
  *
60
- * @example ```ts
61
- *
60
+ * @example
61
+ * ```ts
62
62
  * // Open JMap Cloud NG's online user manual, in a new tab
63
63
  * JMap.Application.openUserManual()
64
64
  * ```
@@ -76,8 +76,8 @@ declare namespace JMap {
76
76
  *
77
77
  * Returns the current draw mode.
78
78
  *
79
- * @example ```ts
80
- *
79
+ * @example
80
+ * ```ts
81
81
  * // return the current draw mode
82
82
  * JMap.Application.Annotation.getDrawMode()
83
83
  * ```
@@ -90,8 +90,8 @@ declare namespace JMap {
90
90
  * Sets the annotation draw mode.
91
91
  *
92
92
  * @param drawMode the new draw mode
93
- * @example ```ts
94
- *
93
+ * @example
94
+ * ```ts
95
95
  * // Set the annotation draw mode to "draw"
96
96
  * JMap.Application.Annotation.setDrawMode("draw")
97
97
  * ```
@@ -103,8 +103,8 @@ declare namespace JMap {
103
103
  *
104
104
  * Returns the current draw type.
105
105
  *
106
- * @example ```ts
107
- *
106
+ * @example
107
+ * ```ts
108
108
  * // return the current draw type
109
109
  * JMap.Application.Annotation.getDrawType()
110
110
  * ```
@@ -117,8 +117,8 @@ declare namespace JMap {
117
117
  * Sets the annotation draw mode.
118
118
  *
119
119
  * @param drawType the new draw type
120
- * @example ```ts
121
- *
120
+ * @example
121
+ * ```ts
122
122
  * // Set the annotation draw mode to "draw"
123
123
  * JMap.Application.Annotation.setDrawMode("draw")
124
124
  * ```
@@ -132,8 +132,8 @@ declare namespace JMap {
132
132
  *
133
133
  * @throws if the annotationId param is not a valid string
134
134
  * @param annotationId the given annotation id
135
- * @example ```ts
136
- *
135
+ * @example
136
+ * ```ts
137
137
  * // return true if annotation exists, else false
138
138
  * JMap.Application.Annotation.existsById("d68385b01be3c241c7b6298b2788839d")
139
139
  * ```
@@ -147,8 +147,8 @@ declare namespace JMap {
147
147
  *
148
148
  * @throws if the annotationId param is not a valid string, or annotation is not found
149
149
  * @param annotationId the given annotation id
150
- * @example ```ts
151
- *
150
+ * @example
151
+ * ```ts
152
152
  * // return the annotation for the given id
153
153
  * JMap.Application.Annotation.getById("d68385b01be3c241c7b6298b2788839d")
154
154
  * ```
@@ -160,8 +160,8 @@ declare namespace JMap {
160
160
  *
161
161
  * Returns all annotations.
162
162
  *
163
- * @example ```ts
164
- *
163
+ * @example
164
+ * ```ts
165
165
  * // return all annotations
166
166
  * JMap.Application.Annotation.getAll()
167
167
  * ```
@@ -175,8 +175,8 @@ declare namespace JMap {
175
175
  *
176
176
  * Empty array if no annotation is selected
177
177
  *
178
- * @example ```ts
179
- *
178
+ * @example
179
+ * ```ts
180
180
  * // return ids of selected annotations
181
181
  * JMap.Application.Annotation.getSelectedIds()
182
182
  * ```
@@ -190,8 +190,8 @@ declare namespace JMap {
190
190
  *
191
191
  * Does nothing if no annotation exists.
192
192
  *
193
- * @example ```ts
194
- *
193
+ * @example
194
+ * ```ts
195
195
  * // Delete all annotations
196
196
  * JMap.Application.Annotation.deleteAll()
197
197
  * ```
@@ -207,8 +207,8 @@ declare namespace JMap {
207
207
  *
208
208
  * @param annotationType the annotation type : "point", "polygon", "line_string", "rectangle", "circle", or "text"
209
209
  * @throws if the annotation type is not correct
210
- * @example ```ts
211
- *
210
+ * @example
211
+ * ```ts
212
212
  * // Delete all text annotations if exist
213
213
  * JMap.Application.Annotation.deleteByType("text")
214
214
  * ```
@@ -222,8 +222,8 @@ declare namespace JMap {
222
222
  *
223
223
  * @param annotationIds an array of annotation id
224
224
  * @throws if an annotation array is empty or an annotation is not found for the given ids.
225
- * @example ```ts
226
- *
225
+ * @example
226
+ * ```ts
227
227
  * // Delete two annotations
228
228
  * JMap.Application.Annotation.deleteByIds([
229
229
  * "d68385b01be3c241c7b6298b2788839d",
@@ -240,8 +240,8 @@ declare namespace JMap {
240
240
  *
241
241
  * Does nothing if no selection.
242
242
  *
243
- * @example ```ts
244
- *
243
+ * @example
244
+ * ```ts
245
245
  * // Delete selected annotations
246
246
  * JMap.Application.Annotation.deleteSelected()
247
247
  * ```
@@ -253,8 +253,8 @@ declare namespace JMap {
253
253
  *
254
254
  * Returns the current style in use for annotation drawing.
255
255
  *
256
- * @example ```ts
257
- *
256
+ * @example
257
+ * ```ts
258
258
  * // return the current style in use for annotation drawing
259
259
  * JMap.Application.Annotation.getStyle()
260
260
  * ```
@@ -268,8 +268,8 @@ declare namespace JMap {
268
268
  *
269
269
  * Merges the new options with current one.
270
270
  *
271
- * @example ```ts
272
- *
271
+ * @example
272
+ * ```ts
273
273
  * // Set the line width as 3px
274
274
  * JMap.Application.Annotation.updateStyle({
275
275
  * lineWidth: 3
@@ -283,8 +283,8 @@ declare namespace JMap {
283
283
  *
284
284
  * For given ids, updates annotation style.
285
285
  *
286
- * @example ```ts
287
- *
286
+ * @example
287
+ * ```ts
288
288
  * const annotationIds = [
289
289
  * "d68385b01be3c241c7b6298b2788839d",
290
290
  * "98ef8ad4476f0e6fa26be416d58d0734"
@@ -306,8 +306,8 @@ declare namespace JMap {
306
306
  * Set the preset colors of color pickers using the given colors.
307
307
  * @param presetColors A array of preset hex colors
308
308
  * @throws if presetColors not an array, does not contain string or is too big
309
- * @example ```ts
310
- *
309
+ * @example
310
+ * ```ts
311
311
  * // Set the preset colors with 2 color
312
312
  * const presetColors = [
313
313
  * "#29D1EA",
@@ -326,8 +326,8 @@ declare namespace JMap {
326
326
  *
327
327
  * @param presetColor A hex color
328
328
  * @throws if presetColor not an string or is empty
329
- * @example ```ts
330
- *
329
+ * @example
330
+ * ```ts
331
331
  * // Add the color #D2FDDF to the preset colors
332
332
  * const presetColor = "#D2FDDF"
333
333
  *
@@ -343,8 +343,8 @@ declare namespace JMap {
343
343
  *
344
344
  * @param presetColor A hex color
345
345
  * @throws if presetColor not an string or is empty
346
- * @example ```ts
347
- *
346
+ * @example
347
+ * ```ts
348
348
  * // Delete the color #D2FDDF from the preset colors
349
349
  * const presetColor = "#D2FDDF"
350
350
  *
@@ -358,13 +358,43 @@ declare namespace JMap {
358
358
  *
359
359
  * Return the preset colors used by the application's color pickers.
360
360
  *
361
- * @example ```ts
362
- *
361
+ * @example
362
+ * ```ts
363
363
  * // Get the current preset colors
364
364
  * JMap.Application.Annotation.getPresetColors()
365
365
  * ```
366
366
  */
367
367
  function getPresetColors(): string[]
368
+
369
+ /**
370
+ * **JMap.Application.Annotation.setSnapEnabled**
371
+ *
372
+ * Enables or disables snap mode.
373
+ *
374
+ * @param isEnabled true to enable snap mode, false to disable
375
+ * @throws if isEnabled is not a boolean
376
+ * @example
377
+ * ```ts
378
+ * // enable snap mode
379
+ * JMap.Application.Annotation.setSnapEnabled(true)
380
+ * ```
381
+ */
382
+ function setSnapEnabled(isEnabled: boolean): void
383
+
384
+ /**
385
+ * **JMap.Application.Annotation.setSnapLayerId**
386
+ *
387
+ * set the layer id to snap on.
388
+ *
389
+ * @param layerId the JMap layer id
390
+ * @throws if layer not found
391
+ * @example
392
+ * ```ts
393
+ * // snap will target the features of the layer having id="36885146-7eed-4071-9f86-8e29c505af91"
394
+ * JMap.Application.Annotation.setSnapLayerId("36885146-7eed-4071-9f86-8e29c505af91")
395
+ * ```
396
+ */
397
+ function setSnapLayerId(layerId: JId): void
368
398
  }
369
399
  /**
370
400
  * **JMap.Application.Panel**
@@ -379,8 +409,8 @@ declare namespace JMap {
379
409
  *
380
410
  * Returns the active panel.
381
411
  *
382
- * @example ```ts
383
- *
412
+ * @example
413
+ * ```ts
384
414
  * // return the currently active panel
385
415
  * JMap.Application.Panel.getActive()
386
416
  * ```
@@ -392,8 +422,8 @@ declare namespace JMap {
392
422
  *
393
423
  * Returns all application panels available.
394
424
  *
395
- * @example ```ts
396
- *
425
+ * @example
426
+ * ```ts
397
427
  * // return all available application panels
398
428
  * JMap.Application.Panel.getAll()
399
429
  * ```
@@ -406,8 +436,8 @@ declare namespace JMap {
406
436
  * Returns true if the panel exists for a given panel id.
407
437
  *
408
438
  * @param panelId The panel id to test
409
- * @example ```ts
410
- *
439
+ * @example
440
+ * ```ts
411
441
  * // return true if panel id="layer" exists
412
442
  * JMap.Application.Panel.existById("custom-panel")
413
443
  * ```
@@ -425,8 +455,8 @@ declare namespace JMap {
425
455
  * @throws if panel is not found
426
456
  * @param panelId The new application panel to activate
427
457
  * @param params optionnal parameters
428
- * @example ```ts
429
- *
458
+ * @example
459
+ * ```ts
430
460
  * // will activate and display the panel id="layer"
431
461
  * JMap.Application.Panel.activateById("layer")
432
462
  * ```
@@ -439,8 +469,8 @@ declare namespace JMap {
439
469
  * Deactivates the current panel, except if the current panel is the layer panel, or if there is only one panel available.
440
470
  *
441
471
  * @param params optionnal parameters
442
- * @example ```ts
443
- *
472
+ * @example
473
+ * ```ts
444
474
  * // will activate the current panel
445
475
  * JMap.Application.Panel.deactivateCurrent()
446
476
  * ```
@@ -454,8 +484,8 @@ declare namespace JMap {
454
484
  *
455
485
  * @throws if panel format is not correct
456
486
  * @param panel an object that is the definition of the new panel
457
- * @example ```ts
458
- *
487
+ * @example
488
+ * ```ts
459
489
  * const customPanelId = "custom-panel"
460
490
  * // will add the new panel, here an empty panel just for the example
461
491
  * JMap.Application.Panel.add({
@@ -481,8 +511,8 @@ declare namespace JMap {
481
511
  *
482
512
  * @throws if panel is not found or if this is the last panel
483
513
  * @param panelId The application panel id to remove
484
- * @example ```ts
485
- *
514
+ * @example
515
+ * ```ts
486
516
  * // will remove the "custom-panel" panel
487
517
  * JMap.Application.Panel.removeById("custom-panel")
488
518
  * ```
@@ -503,8 +533,8 @@ declare namespace JMap {
503
533
  *
504
534
  * @param layerId the JMap layer id
505
535
  * @param featureId the feature id
506
- * @example ```ts
507
- *
536
+ * @example
537
+ * ```ts
508
538
  * // open edit menu (single feature) for layer id=5, and feature id=234
509
539
  * JMap.Application.Feature.openEditMenuById(5, 234)
510
540
  * ```
@@ -518,8 +548,8 @@ declare namespace JMap {
518
548
  *
519
549
  * @param layerId the JMap layer id
520
550
  * @param featureIds an array of features ids
521
- * @example ```ts
522
- *
551
+ * @example
552
+ * ```ts
523
553
  * // open edit menu (multiple edition) for layer id=5, and features id=234, 452 and 176
524
554
  * JMap.Application.Feature.openEditMenuByIds(5, [234, 452, 176])
525
555
  * ```
@@ -533,10 +563,8 @@ declare namespace JMap {
533
563
  *
534
564
  * If not visible, does nothing.
535
565
  *
536
- * @param layerId the JMap layer id
537
- * @param featureIds an array of features ids
538
- * @example ```ts
539
- *
566
+ * @example
567
+ * ```ts
540
568
  * // close the edit menu if visible
541
569
  * JMap.Application.Feature.closeEditMenu()
542
570
  * ```
@@ -550,8 +578,8 @@ declare namespace JMap {
550
578
  *
551
579
  * @param layerId the JMap layer id
552
580
  * @param featureIds an array of features ids
553
- * @example ```ts
554
- *
581
+ * @example
582
+ * ```ts
555
583
  * // delete 2 features on layer id=4
556
584
  * JMap.Application.Feature.deleteByIds(4, [23, 76]).then(result => console.log("Delete result", result))
557
585
  * ```
@@ -571,8 +599,8 @@ declare namespace JMap {
571
599
  * Opens the geometry panel in order to create a new feature.
572
600
  *
573
601
  * @throws if no layer is editable
574
- * @example ```ts
575
- *
602
+ * @example
603
+ * ```ts
576
604
  * // will open the geometry panel
577
605
  * JMap.Application.Geometry.openPanelForCreation()
578
606
  * ```
@@ -585,9 +613,9 @@ declare namespace JMap {
585
613
  * Opens the geometry panel in order to update a feature geometry.
586
614
  *
587
615
  * @throws if the given layer or feature are not editable
588
- * @param JAppGeometryUpdateParams function parameters
589
- * @example ```ts
590
- *
616
+ * @param params function parameters
617
+ * @example
618
+ * ```ts
591
619
  * // will open the geometry panel in order to update the feature geometry
592
620
  * JMap.Application.Geometry.openPanelForUpdate()
593
621
  * ```
@@ -601,8 +629,8 @@ declare namespace JMap {
601
629
  *
602
630
  * @throws if layer not found
603
631
  * @param layerId The JMap layer id
604
- * @example ```ts
605
- *
632
+ * @example
633
+ * ```ts
606
634
  * // will select the layer id=3
607
635
  * JMap.Application.Geometry.selectLayer(3)
608
636
  * ```
@@ -615,8 +643,8 @@ declare namespace JMap {
615
643
  * Enables drawing of the geometry on the map.
616
644
  *
617
645
  * @throws if no layer is selected
618
- * @example ```ts
619
- *
646
+ * @example
647
+ * ```ts
620
648
  * // enable drawing of the geometry on the map
621
649
  * JMap.Application.Geometry.startCreationDrawing()
622
650
  * ```
@@ -628,8 +656,8 @@ declare namespace JMap {
628
656
  *
629
657
  * Stops the geometry creation, when drawing on the map, and displays the layer selection panel.
630
658
  *
631
- * @example ```ts
632
- *
659
+ * @example
660
+ * ```ts
633
661
  * // stop drawing the geometry on the map
634
662
  * JMap.Application.Geometry.stopCreationDrawing()
635
663
  * ```
@@ -642,8 +670,8 @@ declare namespace JMap {
642
670
  * Finishes geometry creation.
643
671
  *
644
672
  * @throws if panel is not in creation mode, or if geometry has not yet been created.
645
- * @example ```ts
646
- *
673
+ * @example
674
+ * ```ts
647
675
  * // finishe creating or updating the geometry
648
676
  * JMap.Application.Geometry.finishCreate()
649
677
  * ```
@@ -656,8 +684,8 @@ declare namespace JMap {
656
684
  * Finishes geometry update.
657
685
  *
658
686
  * @throws if panel is not in update mode
659
- * @example ```ts
660
- *
687
+ * @example
688
+ * ```ts
661
689
  * // finishe updating the geometry
662
690
  * JMap.Application.Geometry.finishUpdate()
663
691
  * ```
@@ -669,13 +697,43 @@ declare namespace JMap {
669
697
  *
670
698
  * Closes the geometry creation or update panel without confirmation message.
671
699
  *
672
- * @example ```ts
673
- *
700
+ * @example
701
+ * ```ts
674
702
  * // close the geometry panel
675
703
  * JMap.Application.Geometry.closePanel()
676
704
  * ```
677
705
  */
678
706
  function closePanel(): void
707
+
708
+ /**
709
+ * **JMap.Application.Geometry.setSnapEnabled**
710
+ *
711
+ * Enables or disables snap mode.
712
+ *
713
+ * @param isEnabled true to enable snap mode, false to disable
714
+ * @throws if isEnabled is not a boolean
715
+ * @example
716
+ * ```ts
717
+ * // enable snap mode
718
+ * JMap.Application.Geometry.setSnapEnabled(true)
719
+ * ```
720
+ */
721
+ function setSnapEnabled(isEnabled: boolean): void
722
+
723
+ /**
724
+ * **JMap.Application.Geometry.setSnapLayerId**
725
+ *
726
+ * set the layer id to snap on.
727
+ *
728
+ * @param layerId the JMap layer id
729
+ * @throws if layer not found
730
+ * @example
731
+ * ```ts
732
+ * // snap will target the features of the layer having id="36885146-7eed-4071-9f86-8e29c505af91"
733
+ * JMap.Application.Geometry.setSnapLayerId("36885146-7eed-4071-9f86-8e29c505af91")
734
+ * ```
735
+ */
736
+ function setSnapLayerId(layerId: JId): void
679
737
  }
680
738
 
681
739
  /**
@@ -689,8 +747,8 @@ declare namespace JMap {
689
747
  *
690
748
  * Returns all measures.
691
749
  *
692
- * @example ```ts
693
- *
750
+ * @example
751
+ * ```ts
694
752
  * // return currently drawn measures
695
753
  * JMap.Application.Measure.getAll()
696
754
  * ```
@@ -703,8 +761,8 @@ declare namespace JMap {
703
761
  * Returns true if a measure exists for the given id, else false.
704
762
  *
705
763
  * @throws Error if measureId is not a string or an empty string
706
- * @example ```ts
707
- *
764
+ * @example
765
+ * ```ts
708
766
  * // return true if the measure exists, else false
709
767
  * JMap.Application.Measure.existsById("ac57b1bd83ca6d8e0013e4cf9f06847e")
710
768
  *
@@ -723,8 +781,8 @@ declare namespace JMap {
723
781
  * Returns the measure for the given id.
724
782
  *
725
783
  * @throws Error if measureId is not a string or an empty string, or if measure is not found
726
- * @example ```ts
727
- *
784
+ * @example
785
+ * ```ts
728
786
  * // return the measure for the given id
729
787
  * JMap.Application.Measure.getById("ac57b1bd83ca6d8e0013e4cf9f06847e")
730
788
  *
@@ -742,8 +800,8 @@ declare namespace JMap {
742
800
  *
743
801
  * Returns all "line" measures. Result contains no polygon or circle measures.
744
802
  *
745
- * @example ```ts
746
- *
803
+ * @example
804
+ * ```ts
747
805
  * // return all line measures
748
806
  * JMap.Application.Measure.getAllLineMeasures()
749
807
  * ```
@@ -755,8 +813,8 @@ declare namespace JMap {
755
813
  *
756
814
  * Returns all "polygon" measures. Result contains no line or circle measures.
757
815
  *
758
- * @example ```ts
759
- *
816
+ * @example
817
+ * ```ts
760
818
  * // return all polygon measures
761
819
  * JMap.Application.Measure.getAllPolygonMeasures()
762
820
  * ```
@@ -768,8 +826,8 @@ declare namespace JMap {
768
826
  *
769
827
  * Returns all "circle" measures. Result contains no line or polygon measures.
770
828
  *
771
- * @example ```ts
772
- *
829
+ * @example
830
+ * ```ts
773
831
  * // return all circle measures
774
832
  * JMap.Application.Measure.getAllCircleMeasures()
775
833
  * ```
@@ -781,8 +839,8 @@ declare namespace JMap {
781
839
  *
782
840
  * Resets measures with provided measures.
783
841
  *
784
- * @example ```ts
785
- *
842
+ * @example
843
+ * ```ts
786
844
  * // remove all measures
787
845
  * JMap.Application.Measure.setAllMeasures([])
788
846
  * ```
@@ -794,8 +852,8 @@ declare namespace JMap {
794
852
  *
795
853
  * Activates a measure type for the drawing measurement tool.
796
854
  * @param measureType The new measure type to apply
797
- * @example ```ts
798
- *
855
+ * @example
856
+ * ```ts
799
857
  * // change the measure type to length
800
858
  * JMap.Application.Measure.activateMeasureType("length")
801
859
  * ```
@@ -807,8 +865,8 @@ declare namespace JMap {
807
865
  *
808
866
  * Returns the current active measure type.
809
867
  *
810
- * @example ```ts
811
- *
868
+ * @example
869
+ * ```ts
812
870
  * // return active mesure type
813
871
  * JMap.Application.Measure.getActiveMeasureType([])
814
872
  * ```
@@ -820,8 +878,8 @@ declare namespace JMap {
820
878
  *
821
879
  * Returns the current measure selection.
822
880
  *
823
- * @example ```ts
824
- *
881
+ * @example
882
+ * ```ts
825
883
  * // return current measure selection
826
884
  * JMap.Application.Measure.getSelectedIds([])
827
885
  * ```
@@ -836,8 +894,8 @@ declare namespace JMap {
836
894
  * If active, measures can be selected by clicking on the map (then changed or removed).
837
895
  *
838
896
  * @param isSelectionActive true to activate selection mode, false to deactivate
839
- * @example ```ts
840
- *
897
+ * @example
898
+ * ```ts
841
899
  * // activate selection of measures
842
900
  * JMap.Application.Measure.setSelectionActive(true)
843
901
  *
@@ -854,8 +912,8 @@ declare namespace JMap {
854
912
  *
855
913
  * Returns deleted measure count.
856
914
  *
857
- * @example ```ts
858
- *
915
+ * @example
916
+ * ```ts
859
917
  * // delete all measures
860
918
  * const deletedMeasuresCount = JMap.Application.Measure.deleteAll()
861
919
  * ```
@@ -869,8 +927,8 @@ declare namespace JMap {
869
927
  *
870
928
  * Returns deleted measure count.
871
929
  *
872
- * @example ```ts
873
- *
930
+ * @example
931
+ * ```ts
874
932
  * // delete all selected measures
875
933
  * const deletedMeasuresCount = JMap.Application.Measure.deleteSelected()
876
934
  * ```
@@ -884,8 +942,8 @@ declare namespace JMap {
884
942
  *
885
943
  * @throws if measure is not found
886
944
  * @param measureIds list of measure ids
887
- * @example ```ts
888
- *
945
+ * @example
946
+ * ```ts
889
947
  * // delete measure having id="bc4fc07f2e84eb50f5962d3d41c836cb"
890
948
  * const deletedMeasuresCount = JMap.Application.Measure.deleteMeasuresById("bc4fc07f2e84eb50f5962d3d41c836cb")
891
949
  * ```
@@ -899,8 +957,8 @@ declare namespace JMap {
899
957
  *
900
958
  * Returns deleted measure count.
901
959
  *
902
- * @example ```ts
903
- *
960
+ * @example
961
+ * ```ts
904
962
  * // delete all line measures (if exist)
905
963
  * const deletedMeasuresCount = JMap.Application.Measure.deleteAllLines()
906
964
  * ```
@@ -914,8 +972,8 @@ declare namespace JMap {
914
972
  *
915
973
  * Returns deleted measure count.
916
974
  *
917
- * @example ```ts
918
- *
975
+ * @example
976
+ * ```ts
919
977
  * // delete all polygon measures (if exist)
920
978
  * const deletedMeasuresCount = JMap.Application.Measure.deleteAllPolygons()
921
979
  * ```
@@ -929,8 +987,8 @@ declare namespace JMap {
929
987
  *
930
988
  * Returns deleted measure count.
931
989
  *
932
- * @example ```ts
933
- *
990
+ * @example
991
+ * ```ts
934
992
  * // delete all circle measures (if exist)
935
993
  * const deletedMeasuresCount = JMap.Application.Measure.deleteAllCircles()
936
994
  * ```
@@ -942,8 +1000,8 @@ declare namespace JMap {
942
1000
  *
943
1001
  * Returns the current measurement system used by the Measurements Panel
944
1002
  *
945
- * @example ```ts
946
- *
1003
+ * @example
1004
+ * ```ts
947
1005
  * // get the current measurement system
948
1006
  * console.log(JMap.Application.Measure.getMeasurementSystem())
949
1007
  * // "geodetic"
@@ -965,13 +1023,43 @@ declare namespace JMap {
965
1023
  * Be warned that lengths or areas in planar context are not representative of the real dimensions on the earth's surface. The only supported planar projection for measurements is EPSG:3857.
966
1024
  *
967
1025
  * @param measurementSystem "geodetic" (default) or "planar"
968
- * @example ```ts
969
- *
1026
+ * @example
1027
+ * ```ts
970
1028
  * // set the current measurement system to "geodetic"
971
1029
  * JMap.Application.Measure.setMeasurementSystem("geodetic")
972
1030
  * ```
973
1031
  */
974
1032
  function setMeasurementSystem(measurementSystem: JAPP_MEASUREMENT_SYSTEMS): void
1033
+
1034
+ /**
1035
+ * **JMap.Application.Measure.setSnapEnabled**
1036
+ *
1037
+ * Enables or disables snap mode.
1038
+ *
1039
+ * @param isEnabled true to enable snap mode, false to disable
1040
+ * @throws if isEnabled is not a boolean
1041
+ * @example
1042
+ * ```ts
1043
+ * // enable snap mode
1044
+ * JMap.Application.Measure.setSnapEnabled(true)
1045
+ * ```
1046
+ */
1047
+ function setSnapEnabled(isEnabled: boolean): void
1048
+
1049
+ /**
1050
+ * **JMap.Application.Measure.setSnapLayerId**
1051
+ *
1052
+ * set the layer id to snap on.
1053
+ *
1054
+ * @param layerId the JMap layer id
1055
+ * @throws if layer not found
1056
+ * @example
1057
+ * ```ts
1058
+ * // snap will target the features of the layer having id="36885146-7eed-4071-9f86-8e29c505af91"
1059
+ * JMap.Application.Measure.setSnapLayerId("36885146-7eed-4071-9f86-8e29c505af91")
1060
+ * ```
1061
+ */
1062
+ function setSnapLayerId(layerId: JId): void
975
1063
  }
976
1064
 
977
1065
  /**
@@ -987,8 +1075,8 @@ declare namespace JMap {
987
1075
  *
988
1076
  * This function returns the id of the layer for which the selection is displayed.
989
1077
  *
990
- * @example ```ts
991
- *
1078
+ * @example
1079
+ * ```ts
992
1080
  * // return the layer id of the displayed selection
993
1081
  * JMap.Application.Selection.getDisplayedLayerId()
994
1082
  * ```
@@ -1003,8 +1091,8 @@ declare namespace JMap {
1003
1091
  * If layer selection has no selection, hides the layer selection list.
1004
1092
  *
1005
1093
  * @throws if layer not found for the given layer id
1006
- * @example ```ts
1007
- *
1094
+ * @example
1095
+ * ```ts
1008
1096
  * // display the layer id=2 selection
1009
1097
  * JMap.Application.Selection.setDisplayedLayerId(2)
1010
1098
  * ```
@@ -1016,8 +1104,8 @@ declare namespace JMap {
1016
1104
  *
1017
1105
  * Changes the current type of selection
1018
1106
  * @param selectionType The new selection type to apply
1019
- * @example ```ts
1020
- *
1107
+ * @example
1108
+ * ```ts
1021
1109
  * // change the selection type to rectangle
1022
1110
  * JMap.Application.Selection.activateSelectionType("rectangle")
1023
1111
  * ```
@@ -1029,8 +1117,8 @@ declare namespace JMap {
1029
1117
  *
1030
1118
  * Returns the current active type of selection
1031
1119
  *
1032
- * @example ```ts
1033
- *
1120
+ * @example
1121
+ * ```ts
1034
1122
  * // return the current active selection type
1035
1123
  * JMap.Application.Selection.getActiveSelectionType()
1036
1124
  * ```
@@ -1042,8 +1130,8 @@ declare namespace JMap {
1042
1130
  *
1043
1131
  * Returns true if the selection data table is diaplayed.
1044
1132
  *
1045
- * @example ```ts
1046
- *
1133
+ * @example
1134
+ * ```ts
1047
1135
  * // return true if the selection data table is visible
1048
1136
  * JMap.Application.Selection.getTableVisibility()
1049
1137
  * ```
@@ -1055,8 +1143,8 @@ declare namespace JMap {
1055
1143
  *
1056
1144
  * Hides or shows the selection data table.
1057
1145
  *
1058
- * @example ```ts
1059
- *
1146
+ * @example
1147
+ * ```ts
1060
1148
  * // make selection data table visible
1061
1149
  * JMap.Application.Selection.setTableVisibility(true)
1062
1150
  *
@@ -1071,8 +1159,8 @@ declare namespace JMap {
1071
1159
  *
1072
1160
  * Returns true if the selection table is displayed in an external browser tab.
1073
1161
  *
1074
- * @example ```ts
1075
- *
1162
+ * @example
1163
+ * ```ts
1076
1164
  * // returns true if the selection table is displayed in an external browser tab.
1077
1165
  * JMap.Application.Selection.isTableDisplayedInTab()
1078
1166
  * ```
@@ -1086,8 +1174,8 @@ declare namespace JMap {
1086
1174
  *
1087
1175
  * If the table is not visible, make it visible.
1088
1176
  *
1089
- * @example ```ts
1090
- *
1177
+ * @example
1178
+ * ```ts
1091
1179
  * // displays the selection table in another tab.
1092
1180
  * JMap.Application.Selection.openTableInTab()
1093
1181
  * ```
@@ -1103,8 +1191,8 @@ declare namespace JMap {
1103
1191
  *
1104
1192
  * If the table is opened in another tab, close the tab and display the table over the map.
1105
1193
  *
1106
- * @example ```ts
1107
- *
1194
+ * @example
1195
+ * ```ts
1108
1196
  * // closes the selection table tab.
1109
1197
  * JMap.Application.Selection.closeTableTab()
1110
1198
  * ```
@@ -1117,8 +1205,8 @@ declare namespace JMap {
1117
1205
  * Unselects all features for a given layer id.
1118
1206
  *
1119
1207
  * @param layerId the JMap layer id
1120
- * @example ```ts
1121
- *
1208
+ * @example
1209
+ * ```ts
1122
1210
  * // clear the layer id=2 selection
1123
1211
  * JMap.Application.Selection.clearSelectionForLayer(2)
1124
1212
  * ```
@@ -1130,7 +1218,8 @@ declare namespace JMap {
1130
1218
  *
1131
1219
  * Clears the current selection
1132
1220
  *
1133
- * @example ```ts
1221
+ * @example
1222
+ * ```ts
1134
1223
  * // Clear the current selection
1135
1224
  * JMap.Application.Selection.clearSelection()
1136
1225
  * ```
@@ -1144,7 +1233,8 @@ declare namespace JMap {
1144
1233
  *
1145
1234
  * @param feature the given feature
1146
1235
  * @param selectionType if not provided the method use
1147
- * @example ```ts
1236
+ * @example
1237
+ * ```ts
1148
1238
  * // will select all features that intersect the provided line feature
1149
1239
  * JMap.Application.Selection.selectFromFeature(lineFeature)
1150
1240
  * ```
@@ -1158,7 +1248,8 @@ declare namespace JMap {
1158
1248
  *
1159
1249
  * If no selection, export an empty file.
1160
1250
  *
1161
- * @example ```ts
1251
+ * @example
1252
+ * ```ts
1162
1253
  * // download the current selection as an excel file
1163
1254
  * JMap.Application.Selection.exportAsExcelFile()
1164
1255
  * ```
@@ -1171,7 +1262,8 @@ declare namespace JMap {
1171
1262
  * Pans and zooms the map to display the current selection.
1172
1263
  *
1173
1264
  * @param options optional options
1174
- * @example ```ts
1265
+ * @example
1266
+ * ```ts
1175
1267
  * // fit the map to display selected features
1176
1268
  * JMap.Application.Selection.fitMapToDisplayLayerSelection()
1177
1269
  * ```
@@ -1197,8 +1289,8 @@ declare namespace JMap {
1197
1289
  * @throws if project id invalid or project not found
1198
1290
  * @param projectId the JMap project id
1199
1291
  * @returns the project
1200
- * @example ```ts
1201
- *
1292
+ * @example
1293
+ * ```ts
1202
1294
  * // activate project id=33
1203
1295
  * JMap.Application.Project.activateById(33)
1204
1296
  * ```
@@ -1210,8 +1302,8 @@ declare namespace JMap {
1210
1302
  *
1211
1303
  * Displays or hides the project list selection panel.
1212
1304
  *
1213
- * @example ```ts
1214
- *
1305
+ * @example
1306
+ * ```ts
1215
1307
  * // display the project list selection panel
1216
1308
  * JMap.Application.Project.setSelectionPanelVisibility(true)
1217
1309
  * ```
@@ -1246,8 +1338,8 @@ declare namespace JMap {
1246
1338
  * diacritical characters insensitive.
1247
1339
  *
1248
1340
  * @param nameFilter the name filter to apply
1249
- * @example ```ts
1250
- *
1341
+ * @example
1342
+ * ```ts
1251
1343
  * // In the layer panel will display only layers whose name matches "pro" (case-insensitive)
1252
1344
  * JMap.Application.Layer.setName("pro")
1253
1345
  * ```
@@ -1265,8 +1357,8 @@ declare namespace JMap {
1265
1357
  * a) the name filter contains at least 2 characters
1266
1358
  * b) one of the layer filters has been added to the filtering configuration
1267
1359
  *
1268
- * @example ```ts
1269
- *
1360
+ * @example
1361
+ * ```ts
1270
1362
  * // filter configuration is initially empty
1271
1363
  *
1272
1364
  * // activate the filters
@@ -1290,8 +1382,8 @@ declare namespace JMap {
1290
1382
  * or by calling a JMap Cloud NG API method to activate it.
1291
1383
  * See {@link JMap.Application.Layer.Tree.Filter.isApplied} for more details.
1292
1384
  *
1293
- * @example ```ts
1294
- *
1385
+ * @example
1386
+ * ```ts
1295
1387
  * // activate the filters
1296
1388
  * JMap.Application.Layer.Tree.Filter.setActive(false)
1297
1389
  *
@@ -1311,8 +1403,8 @@ declare namespace JMap {
1311
1403
  * See {@link JMap.Application.Layer.Tree.Filter.isApplied} for more details
1312
1404
  *
1313
1405
  * @param active a boolean
1314
- * @example ```ts
1315
- *
1406
+ * @example
1407
+ * ```ts
1316
1408
  * // activate the filters
1317
1409
  * JMap.Application.Layer.Tree.Filter.setActive(false)
1318
1410
  *
@@ -1328,8 +1420,8 @@ declare namespace JMap {
1328
1420
  * Applies the current filter configuration on the map. All layers not matching the filter will be hidden, and only those
1329
1421
  * that match the filter will stay visible on the map. If no filter is defined (or appliable), no change is applied on the map.
1330
1422
  *
1331
- * @example ```ts
1332
- *
1423
+ * @example
1424
+ * ```ts
1333
1425
  * // Apply the current filter
1334
1426
  * JMap.Application.Layer.Tree.Filter.applyToMap()
1335
1427
  * ```
@@ -1342,8 +1434,8 @@ declare namespace JMap {
1342
1434
  * Tests if the specified filter exists.
1343
1435
  *
1344
1436
  * @param filterId the filter id
1345
- * @example ```ts
1346
- *
1437
+ * @example
1438
+ * ```ts
1347
1439
  * // create a filter
1348
1440
  * JMap.Application.Layer.Tree.Filter.add({
1349
1441
  * 1,
@@ -1365,8 +1457,8 @@ declare namespace JMap {
1365
1457
  * Tests if at least one filter associated with the specified metadata id exists.
1366
1458
  *
1367
1459
  * @param metadataId the metadata id
1368
- * @example ```ts
1369
- *
1460
+ * @example
1461
+ * ```ts
1370
1462
  * // filter collection is initially empty
1371
1463
  *
1372
1464
  * // create a filter
@@ -1389,8 +1481,8 @@ declare namespace JMap {
1389
1481
  *
1390
1482
  * Returns an object containing the current name filter and an array of all current filters.
1391
1483
  *
1392
- * @example ```ts
1393
- *
1484
+ * @example
1485
+ * ```ts
1394
1486
  * // get filters configuration
1395
1487
  * console.log(JMap.Application.Layer.Tree.Filter.getAll())
1396
1488
  * // {
@@ -1417,8 +1509,8 @@ declare namespace JMap {
1417
1509
  * Retrieves the specified filter by id.
1418
1510
  *
1419
1511
  * @param filterId the filter id
1420
- * @example ```ts
1421
- *
1512
+ * @example
1513
+ * ```ts
1422
1514
  * // get filter id=1
1423
1515
  * JMap.Application.Layer.Tree.Filter.getById(1)
1424
1516
  * // {"id":1,
@@ -1440,8 +1532,8 @@ declare namespace JMap {
1440
1532
  * Adds a filter. The list of available metadata schema items can be retieved by calling {@link JMap.Layer.getMetadataSchema}.
1441
1533
  *
1442
1534
  * @param filter a JAppAnyLayerFilter object
1443
- * @example ```ts
1444
- *
1535
+ * @example
1536
+ * ```ts
1445
1537
  * // add a filter to the config
1446
1538
  * JMap.Application.Layer.Tree.Filter.add({
1447
1539
  * 1,
@@ -1460,8 +1552,8 @@ declare namespace JMap {
1460
1552
  * Removes the specified filter from the filter configuration.
1461
1553
  *
1462
1554
  * @param filterId the id of the filter to delete
1463
- * @example ```ts
1464
- *
1555
+ * @example
1556
+ * ```ts
1465
1557
  * // delete filter id=1
1466
1558
  * JMap.Application.Layer.Tree.Filter.deleteById(1)
1467
1559
  * ```
@@ -1473,8 +1565,8 @@ declare namespace JMap {
1473
1565
  *
1474
1566
  * Opens the Add Filter dialog box, and activates the Layer panel if it is not already active.
1475
1567
  *
1476
- * @example ```ts
1477
- *
1568
+ * @example
1569
+ * ```ts
1478
1570
  * // open Add Filter UI
1479
1571
  * JMap.Application.Layer.Tree.Filter.openAddFilterDialog()
1480
1572
  * ```
@@ -1486,8 +1578,8 @@ declare namespace JMap {
1486
1578
  *
1487
1579
  * Closes the Add Filter dialog box (without saving the filter).
1488
1580
  *
1489
- * @example ```ts
1490
- *
1581
+ * @example
1582
+ * ```ts
1491
1583
  * // close Add Filter UI
1492
1584
  * JMap.Application.Layer.Tree.Filter.closeAddFilterDialog()
1493
1585
  * ```
@@ -1515,8 +1607,8 @@ declare namespace JMap {
1515
1607
  *
1516
1608
  * @throws if layer not found
1517
1609
  * @param layerId the JMap layer id
1518
- * @example ```ts
1519
- *
1610
+ * @example
1611
+ * ```ts
1520
1612
  * // opens the edition panel, with the "dynamic-filter" tab activated, for layer id=3.
1521
1613
  * JMap.Application.Layer.Edition.DynamicFilter.openPanel(3)
1522
1614
  * ```
@@ -1528,8 +1620,8 @@ declare namespace JMap {
1528
1620
  *
1529
1621
  * If open, closes the edition panel.
1530
1622
  *
1531
- * @example ```ts
1532
- *
1623
+ * @example
1624
+ * ```ts
1533
1625
  * // closes the dynamic filter panel if open.
1534
1626
  * JMap.Application.Layer.Edition.DynamicFilter.closePanel()
1535
1627
  * ```
@@ -1543,8 +1635,8 @@ declare namespace JMap {
1543
1635
  *
1544
1636
  * @throws if layer not found
1545
1637
  * @param layerId the JMap layer id
1546
- * @example ```ts
1547
- *
1638
+ * @example
1639
+ * ```ts
1548
1640
  * // opens the dynamic filter creation dialog for layer id=3
1549
1641
  * JMap.Application.Layer.Edition.DynamicFilter.openCreateDialog(3)
1550
1642
  * ```
@@ -1559,8 +1651,8 @@ declare namespace JMap {
1559
1651
  * @throws if layer or condition not found
1560
1652
  * @param layerId the JMap layer id
1561
1653
  * @param conditionId the JMap dynamic filter condition id
1562
- * @example ```ts
1563
- *
1654
+ * @example
1655
+ * ```ts
1564
1656
  * // opens the dynamic filter condition creation dialog for layer id=3
1565
1657
  * JMap.Application.Layer.Edition.DynamicFilter.openUpdateDialog(3)
1566
1658
  * ```
@@ -1572,8 +1664,8 @@ declare namespace JMap {
1572
1664
  *
1573
1665
  * If open, close the dynamic filter dialog (as well for creation or update).
1574
1666
  *
1575
- * @example ```ts
1576
- *
1667
+ * @example
1668
+ * ```ts
1577
1669
  * // closes the edition (any tab) panel if open.
1578
1670
  * JMap.Application.Layer.Edition.DynamicFilter.closeDialog()
1579
1671
  * ```
@@ -1594,8 +1686,8 @@ declare namespace JMap {
1594
1686
  *
1595
1687
  * @throws if layer not found
1596
1688
  * @param layerId the JMap layer id
1597
- * @example ```ts
1598
- *
1689
+ * @example
1690
+ * ```ts
1599
1691
  * // open the edition panel, with "info" tab activated, for layer id=3.
1600
1692
  * JMap.Application.Layer.Edition.Info.openPanel(3)
1601
1693
  * ```
@@ -1607,8 +1699,8 @@ declare namespace JMap {
1607
1699
  *
1608
1700
  * If open, closes the edition panel.
1609
1701
  *
1610
- * @example ```ts
1611
- *
1702
+ * @example
1703
+ * ```ts
1612
1704
  * // closes the edition (any tab) panel if open.
1613
1705
  * JMap.Application.Layer.Edition.DynamicFilter.closePanel()
1614
1706
  * ```
@@ -1629,8 +1721,8 @@ declare namespace JMap {
1629
1721
  *
1630
1722
  * @throws if layer not found
1631
1723
  * @param layerId the JMap layer id
1632
- * @example ```ts
1633
- *
1724
+ * @example
1725
+ * ```ts
1634
1726
  * // opens the edition panel, with "thematics" tab activated, for layer id=3.
1635
1727
  * JMap.Application.Layer.Edition.Thematic.openPanel(3)
1636
1728
  * ```
@@ -1642,8 +1734,8 @@ declare namespace JMap {
1642
1734
  *
1643
1735
  * If open, closes the edition panel.
1644
1736
  *
1645
- * @example ```ts
1646
- *
1737
+ * @example
1738
+ * ```ts
1647
1739
  * // closes the edition (any tab) panel if open.
1648
1740
  * JMap.Application.Layer.Edition.DynamicFilter.closePanel()
1649
1741
  * ```
@@ -1663,8 +1755,8 @@ declare namespace JMap {
1663
1755
  * @throws If layer is not found or layerId is correspond to a layer group, if activeTab is incorrect
1664
1756
  * @param layerId JMap layer id
1665
1757
  * @param activeTab the tab to display: "thematics" or "dynamic-filter"
1666
- * @example ```ts
1667
- *
1758
+ * @example
1759
+ * ```ts
1668
1760
  * // edits the layer's id="3" thematics (if layer 3 has at least one thematic set)
1669
1761
  * JMap.Application.Layer.Edition.openPanel(3, "thematics")
1670
1762
  *
@@ -1679,8 +1771,8 @@ declare namespace JMap {
1679
1771
  *
1680
1772
  * If layer edition panel is opened, will close it. Will stop edition and show the layer tree panel.
1681
1773
  *
1682
- * @example ```ts
1683
- *
1774
+ * @example
1775
+ * ```ts
1684
1776
  * // closes the layer edition panel
1685
1777
  * JMap.Application.Layer.Edition.closePanel()
1686
1778
  * ```
@@ -1706,8 +1798,8 @@ declare namespace JMap {
1706
1798
  *
1707
1799
  * Returns the DOM div element id where application UI has been inserted.
1708
1800
  *
1709
- * @example ```ts
1710
- *
1801
+ * @example
1802
+ * ```ts
1711
1803
  * // return the dom container id, ex : "jmapcloud-ng-types"
1712
1804
  * JMap.Application.UI.Container.getId()
1713
1805
  * ```
@@ -1719,8 +1811,8 @@ declare namespace JMap {
1719
1811
  *
1720
1812
  * Returns the dom container width in pixel.
1721
1813
  *
1722
- * @example ```ts
1723
- *
1814
+ * @example
1815
+ * ```ts
1724
1816
  * // return the dom container width, ex : 1230
1725
1817
  * JMap.Application.UI.Container.getWidth()
1726
1818
  * ```
@@ -1732,8 +1824,8 @@ declare namespace JMap {
1732
1824
  *
1733
1825
  * Returns the dom container height in pixel.
1734
1826
  *
1735
- * @example ```ts
1736
- *
1827
+ * @example
1828
+ * ```ts
1737
1829
  * // return the dom container height, ex : 966
1738
1830
  * JMap.Application.UI.Container.getHeight()
1739
1831
  * ```
@@ -1746,8 +1838,8 @@ declare namespace JMap {
1746
1838
  * Returns a polygon geometry representing the visible coordinates on the map.
1747
1839
  * Works fine even if the map is pitched or rotated.
1748
1840
  * @throws if map is not loaded
1749
- * @example ```ts
1750
- *
1841
+ * @example
1842
+ * ```ts
1751
1843
  * // returns the polygon geometry representing the visible coordinates on the map.
1752
1844
  * // ex :
1753
1845
  * // {
@@ -1776,8 +1868,8 @@ declare namespace JMap {
1776
1868
  * Sets the application left side panel visibility.
1777
1869
  *
1778
1870
  * @param isVisible if true, shows the panel, else hides it
1779
- * @example ```ts
1780
- *
1871
+ * @example
1872
+ * ```ts
1781
1873
  * // Show the left side panel
1782
1874
  * JMap.Application.UI.Sidepanel.setVisible(true)
1783
1875
  *
@@ -1792,8 +1884,8 @@ declare namespace JMap {
1792
1884
  *
1793
1885
  * Returns true if the JMap Cloud NG main panel on the left is opened.
1794
1886
  *
1795
- * @example ```ts
1796
- *
1887
+ * @example
1888
+ * ```ts
1797
1889
  * // returns true if side panel is opened
1798
1890
  * JMap.Application.UI.SidePanel.isVisible()
1799
1891
  * ```
@@ -1809,8 +1901,8 @@ declare namespace JMap {
1809
1901
  *
1810
1902
  * If the panel is closed, it will open.
1811
1903
  *
1812
- * @example ```ts
1813
- *
1904
+ * @example
1905
+ * ```ts
1814
1906
  * // change the side panel visibility
1815
1907
  * JMap.Application.UI.SidePanel.toggleVisibility()
1816
1908
  * ```
@@ -1822,8 +1914,8 @@ declare namespace JMap {
1822
1914
  *
1823
1915
  * Returns the width of the opened side panel in rem.
1824
1916
  *
1825
- * @example ```ts
1826
- *
1917
+ * @example
1918
+ * ```ts
1827
1919
  * // returns "28.125rem"
1828
1920
  * JMap.Application.UI.SidePanel.getWidthOpenInRem()
1829
1921
  * ```
@@ -1835,8 +1927,8 @@ declare namespace JMap {
1835
1927
  *
1836
1928
  * Returns the width of the opened side panel in pixel.
1837
1929
  *
1838
- * @example ```ts
1839
- *
1930
+ * @example
1931
+ * ```ts
1840
1932
  * // returns 450
1841
1933
  * JMap.Application.UI.SidePanel.getWidthOpenInPixel()
1842
1934
  * ```
@@ -1848,8 +1940,8 @@ declare namespace JMap {
1848
1940
  *
1849
1941
  * Returns the minimum side panel width.
1850
1942
  *
1851
- * @example ```ts
1852
- *
1943
+ * @example
1944
+ * ```ts
1853
1945
  * // returns the minimum side panel width
1854
1946
  * JMap.Application.UI.SidePanel.getMinimumWidthOpenInPixel()
1855
1947
  * ```
@@ -1862,9 +1954,9 @@ declare namespace JMap {
1862
1954
  * Returns the minimum side panel width.
1863
1955
  *
1864
1956
  * @throws if new width is not a number, or lower than minimum width
1865
- * @param width: new panel width in pixel
1866
- * @example ```ts
1867
- *
1957
+ * @param width new panel width in pixel
1958
+ * @example
1959
+ * ```ts
1868
1960
  * const newWidth = 500
1869
1961
  * if (JMap.Application.UI.SidePanel.getMinimumWidthOpenInPixel() <= newWidth) {
1870
1962
  * // returns the minimum side panel width
@@ -1879,8 +1971,8 @@ declare namespace JMap {
1879
1971
  *
1880
1972
  * Returns the width of the closed side panel in rem.
1881
1973
  *
1882
- * @example ```ts
1883
- *
1974
+ * @example
1975
+ * ```ts
1884
1976
  * // returns "3.75rem"
1885
1977
  * JMap.Application.UI.SidePanel.getWidthCloseInRem()
1886
1978
  * ```
@@ -1892,8 +1984,8 @@ declare namespace JMap {
1892
1984
  *
1893
1985
  * Returns the width of the closed side panel in pixel.
1894
1986
  *
1895
- * @example ```ts
1896
- *
1987
+ * @example
1988
+ * ```ts
1897
1989
  * // returns 60
1898
1990
  * JMap.Application.UI.SidePanel.getWidthCloseInPixel()
1899
1991
  * ```
@@ -1905,8 +1997,8 @@ declare namespace JMap {
1905
1997
  *
1906
1998
  * Returns the width of the main panel (side panel width minus menu width) in rem.
1907
1999
  *
1908
- * @example ```ts
1909
- *
2000
+ * @example
2001
+ * ```ts
1910
2002
  * // returns "24.375rem"
1911
2003
  * JMap.Application.UI.SidePanel.getMainPanelWidthInRem()
1912
2004
  * ```
@@ -1918,8 +2010,8 @@ declare namespace JMap {
1918
2010
  *
1919
2011
  * Returns the width of the main panel (side panel width minus menu width) in pixel.
1920
2012
  *
1921
- * @example ```ts
1922
- *
2013
+ * @example
2014
+ * ```ts
1923
2015
  * // returns 390
1924
2016
  * JMap.Application.UI.SidePanel.getMainPanelWidthInPixel()
1925
2017
  * ```
@@ -1931,8 +2023,8 @@ declare namespace JMap {
1931
2023
  *
1932
2024
  * Returns the min height of the Panel header section (where the project name is displayed) in rem.
1933
2025
  *
1934
- * @example ```ts
1935
- *
2026
+ * @example
2027
+ * ```ts
1936
2028
  * // returns "5rem"
1937
2029
  * JMap.Application.UI.SidePanel.getHeaderMinHeightInRem()
1938
2030
  * ```
@@ -1944,8 +2036,8 @@ declare namespace JMap {
1944
2036
  *
1945
2037
  * Returns the min height of the Panel header section (where the project name is displayed) in pixels.
1946
2038
  *
1947
- * @example ```ts
1948
- *
2039
+ * @example
2040
+ * ```ts
1949
2041
  * // returns 80
1950
2042
  * JMap.Application.UI.SidePanel.getHeaderMinHeightInPixel()
1951
2043
  * ```
@@ -1957,8 +2049,8 @@ declare namespace JMap {
1957
2049
  *
1958
2050
  * Returns the min height of the Panel title section (where the panel name is displayed) in rem.
1959
2051
  *
1960
- * @example ```ts
1961
- *
2052
+ * @example
2053
+ * ```ts
1962
2054
  * // returns "4rem"
1963
2055
  * JMap.Application.UI.SidePanel.getTitleMinHeightInRem()
1964
2056
  * ```
@@ -1970,14 +2062,80 @@ declare namespace JMap {
1970
2062
  *
1971
2063
  * Returns the min height of the Panel title section (where the panel name is displayed) in pixels.
1972
2064
  *
1973
- * @example ```ts
1974
- *
2065
+ * @example
2066
+ * ```ts
1975
2067
  * // returns 64
1976
2068
  * JMap.Application.UI.SidePanel.getTitleMinHeightInPixel()
1977
2069
  * ```
1978
2070
  */
1979
2071
  function getTitleMinHeightInPixel(): number
1980
2072
  }
2073
+ /**
2074
+ * **JMap.Application.UI.Map**
2075
+ *
2076
+ * You can manage the Map UI here.
2077
+ */
2078
+ namespace Map {
2079
+ /**
2080
+ * **JMap.Application.UI.Map.isGeocodingControlVisible**
2081
+ *
2082
+ * Returns true if the geocoding control is currently visible.
2083
+ *
2084
+ * @example
2085
+ * ```ts
2086
+ * // true or false
2087
+ * JMap.Application.UI.Map.isGeocodingControlVisible()
2088
+ * ```
2089
+ */
2090
+ function isGeocodingControlVisible(): boolean
2091
+
2092
+ /**
2093
+ * **JMap.Application.UI.Map.setGeocodingControlVisibility**
2094
+ *
2095
+ * Displays or hides the geocoding control.
2096
+ *
2097
+ * @param isVisible true to display, false to hide
2098
+ * @example
2099
+ * ```ts
2100
+ * // Display the geocoding control
2101
+ * JMap.Application.UI.Map.setGeocodingControlVisibility(true)
2102
+ *
2103
+ * // Hide the geocoding control
2104
+ * JMap.Application.UI.Map.setGeocodingControlVisibility(false)
2105
+ * ```
2106
+ */
2107
+ function setGeocodingControlVisibility(isVisible: boolean): void
2108
+
2109
+ /**
2110
+ * **JMap.Application.UI.Map.isSimpleSearchControlVisible**
2111
+ *
2112
+ * Returns true if the Simple Search control is currently visible.
2113
+ *
2114
+ * @example
2115
+ * ```ts
2116
+ * // true or false
2117
+ * JMap.Application.UI.Map.isSimpleSearchControlVisible()
2118
+ * ```
2119
+ */
2120
+ function isSimpleSearchControlVisible(): boolean
2121
+
2122
+ /**
2123
+ * **JMap.Application.UI.Map.setSimpleSearchControlVisibility**
2124
+ *
2125
+ * Displays or hides the Simple Search control.
2126
+ *
2127
+ * @param isVisible true to display, false to hide
2128
+ * @example
2129
+ * ```ts
2130
+ * // Display the Simple Search control
2131
+ * JMap.Application.UI.Map.setSimpleSearchControlVisibility(true)
2132
+ *
2133
+ * // Hide the Simple Search control
2134
+ * JMap.Application.UI.Map.setSimpleSearchControlVisibility(false)
2135
+ * ```
2136
+ */
2137
+ function setSimpleSearchControlVisibility(isVisible: boolean): void
2138
+ }
1981
2139
 
1982
2140
  /**
1983
2141
  * **JMap.Application.UI.Theme**
@@ -1990,8 +2148,8 @@ declare namespace JMap {
1990
2148
  *
1991
2149
  * Returns true if the theme is currently dark.
1992
2150
  *
1993
- * @example ```ts
1994
- *
2151
+ * @example
2152
+ * ```ts
1995
2153
  * // true or false
1996
2154
  * JMap.Application.UI.Theme.isDark()
1997
2155
  * ```
@@ -2004,8 +2162,8 @@ declare namespace JMap {
2004
2162
  * Changes the UI color theme in dark or light.
2005
2163
  *
2006
2164
  * @param isDark if true make the theme dark, else light
2007
- * @example ```ts
2008
- *
2165
+ * @example
2166
+ * ```ts
2009
2167
  * // make the theme dark
2010
2168
  * JMap.Application.UI.Theme.setDark()
2011
2169
  *
@@ -2032,8 +2190,8 @@ declare namespace JMap {
2032
2190
  * Displays or hides the scale control widget.
2033
2191
  *
2034
2192
  * @param isVisible true to display, false to hide
2035
- * @example ```ts
2036
- *
2193
+ * @example
2194
+ * ```ts
2037
2195
  * // Display the scale
2038
2196
  * JMap.Application.Print.setScaleControlVisibility(true)
2039
2197
  *
@@ -2048,8 +2206,8 @@ declare namespace JMap {
2048
2206
  *
2049
2207
  * Returns true if the scale control widget is visible, else false.
2050
2208
  *
2051
- * @example ```ts
2052
- *
2209
+ * @example
2210
+ * ```ts
2053
2211
  * // true if the scale controle widget is displayed
2054
2212
  * JMap.Application.Print.isScaleControlVisible()
2055
2213
  * ```
@@ -2065,8 +2223,8 @@ declare namespace JMap {
2065
2223
  *
2066
2224
  * @throws if title is not a string
2067
2225
  * @param title The title displayed in the bottom of the print layout
2068
- * @example ```ts
2069
- *
2226
+ * @example
2227
+ * ```ts
2070
2228
  * // set title
2071
2229
  * JMap.Application.Print.setPageTitle("My custom title")
2072
2230
  * ```
@@ -2078,8 +2236,8 @@ declare namespace JMap {
2078
2236
  *
2079
2237
  * Returns the title displayed in the bottom of the print layout.
2080
2238
  *
2081
- * @example ```ts
2082
- *
2239
+ * @example
2240
+ * ```ts
2083
2241
  * // returns the displayed title
2084
2242
  * JMap.Application.Print.getPageTitle()
2085
2243
  * ```
@@ -2093,8 +2251,8 @@ declare namespace JMap {
2093
2251
  *
2094
2252
  * @throws if subTitle is not a string
2095
2253
  * @param subTitle The subtitle displayed in the bottom of the print layout
2096
- * @example ```ts
2097
- *
2254
+ * @example
2255
+ * ```ts
2098
2256
  * // set subtitle
2099
2257
  * JMap.Application.Print.setPageSubTitle("My custom subtitle")
2100
2258
  * ```
@@ -2106,8 +2264,8 @@ declare namespace JMap {
2106
2264
  *
2107
2265
  * Returns the subtitle displayed in the bottom of the print layout.
2108
2266
  *
2109
- * @example ```ts
2110
- *
2267
+ * @example
2268
+ * ```ts
2111
2269
  * // returns the displayed subtitle
2112
2270
  * JMap.Application.Print.getPageSubTitle()
2113
2271
  * ```
@@ -2119,8 +2277,8 @@ declare namespace JMap {
2119
2277
  *
2120
2278
  * Returns true if the date is displayed in the bottom of the print layout.
2121
2279
  *
2122
- * @example ```ts
2123
- *
2280
+ * @example
2281
+ * ```ts
2124
2282
  * // returns true if the date is visible
2125
2283
  * JMap.Application.Print.isDateVisibile()
2126
2284
  * ```
@@ -2133,8 +2291,8 @@ declare namespace JMap {
2133
2291
  * Sets the date visible or hidden in the bottom of the print layout.
2134
2292
  *
2135
2293
  * @param isVisible true to display, false to hide
2136
- * @example ```ts
2137
- *
2294
+ * @example
2295
+ * ```ts
2138
2296
  * // Hide the date
2139
2297
  * JMap.Application.Print.setDateVisibility(false)
2140
2298
  *
@@ -2149,8 +2307,8 @@ declare namespace JMap {
2149
2307
  *
2150
2308
  * Returns true if the north arrow is displayed in the bottom of the print layout.
2151
2309
  *
2152
- * @example ```ts
2153
- *
2310
+ * @example
2311
+ * ```ts
2154
2312
  * // returns true if the north arrow is visible
2155
2313
  * JMap.Application.Print.isNorthArrowVisible()
2156
2314
  * ```
@@ -2163,8 +2321,8 @@ declare namespace JMap {
2163
2321
  * Sets the north arrow visible or hidden in the bottom of the print layout.
2164
2322
  *
2165
2323
  * @param isVisible true to display, false to hide
2166
- * @example ```ts
2167
- *
2324
+ * @example
2325
+ * ```ts
2168
2326
  * // Hide the north arrow
2169
2327
  * JMap.Application.Print.setNorthArrowVisibility(false)
2170
2328
  *
@@ -2181,9 +2339,8 @@ declare namespace JMap {
2181
2339
  *
2182
2340
  * Different sizes are available: "letter" | "legal" | "a3" | "a4".
2183
2341
  *
2184
- * @deprecated will be removed in the futur
2185
- * @example ```ts
2186
- *
2342
+ * @example
2343
+ * ```ts
2187
2344
  * // returns all available paper formats
2188
2345
  * JMap.Application.Print.getAllPaperFormats()
2189
2346
  * ```
@@ -2197,11 +2354,10 @@ declare namespace JMap {
2197
2354
  *
2198
2355
  * Technical method, you should not use it.
2199
2356
  *
2200
- * @deprecated will be removed in the futur
2201
2357
  * @throws if format is incorrect
2202
- * @param the paper format object or a {@link JAPP_PRINT_PAPER_SIZES}
2203
- * @example ```ts
2204
- *
2358
+ * @param format the paper format object or a {@link JAPP_PRINT_PAPER_SIZES}
2359
+ * @example
2360
+ * ```ts
2205
2361
  * // set the letter paper format
2206
2362
  * JMap.Application.Print.setPaperFormat("letter")
2207
2363
  * ```
@@ -2213,9 +2369,8 @@ declare namespace JMap {
2213
2369
  *
2214
2370
  * Returns the active paper format.
2215
2371
  *
2216
- * @deprecated will be removed in the futur
2217
- * @example ```ts
2218
- *
2372
+ * @example
2373
+ * ```ts
2219
2374
  * // returns active paper format
2220
2375
  * JMap.Application.Print.getPaperFormat()
2221
2376
  * ```
@@ -2227,8 +2382,8 @@ declare namespace JMap {
2227
2382
  *
2228
2383
  * Returns true if the print layout is portrait, else false (landscape).
2229
2384
  *
2230
- * @example ```ts
2231
- *
2385
+ * @example
2386
+ * ```ts
2232
2387
  * // returns true if the print layout is portrait, else false (landscape)
2233
2388
  * JMap.Application.Print.isOrientationPortrait()
2234
2389
  * ```
@@ -2242,8 +2397,8 @@ declare namespace JMap {
2242
2397
  *
2243
2398
  * @throws if isPortrait is not a boolean
2244
2399
  * @param isPortrait true to display as portrait, false as landscape
2245
- * @example ```ts
2246
- *
2400
+ * @example
2401
+ * ```ts
2247
2402
  * // set the layout as portrait
2248
2403
  * JMap.Application.Print.setOrientation(true)
2249
2404
  *
@@ -2260,8 +2415,8 @@ declare namespace JMap {
2260
2415
  *
2261
2416
  * One of the following: "png" | "jpeg" | "pdf"
2262
2417
  *
2263
- * @example ```ts
2264
- *
2418
+ * @example
2419
+ * ```ts
2265
2420
  * // returns "png", "jpeg", or "pdf"
2266
2421
  * JMap.Application.Print.getFileType()
2267
2422
  * ```
@@ -2275,8 +2430,8 @@ declare namespace JMap {
2275
2430
  *
2276
2431
  * @throws if fileType is not correct
2277
2432
  * @param fileType "png", "jpeg", or "pdf"
2278
- * @example ```ts
2279
- *
2433
+ * @example
2434
+ * ```ts
2280
2435
  * // set the layout as portrait
2281
2436
  * JMap.Application.Print.setFileType("pdf")
2282
2437
  * ```
@@ -2290,8 +2445,8 @@ declare namespace JMap {
2290
2445
  *
2291
2446
  * @throws if isHiResolution is not a boolean
2292
2447
  * @param isHiResolution true or false
2293
- * @example ```ts
2294
- *
2448
+ * @example
2449
+ * ```ts
2295
2450
  * // set export mode to hi resolution
2296
2451
  * JMap.Application.Print.setHiResolution(true)
2297
2452
  * ```
@@ -2303,8 +2458,8 @@ declare namespace JMap {
2303
2458
  *
2304
2459
  * Returns true if the map export is set to hi resolution, false otherwise.
2305
2460
  *
2306
- * @example ```ts
2307
- *
2461
+ * @example
2462
+ * ```ts
2308
2463
  * // get export resolution
2309
2464
  * JMap.Application.Print.getHiResolution()
2310
2465
  * // true
@@ -2315,155 +2470,43 @@ declare namespace JMap {
2315
2470
  /**
2316
2471
  * **JMap.Application.Print.takeCapture**
2317
2472
  *
2318
- * Builds print image and launches downwnload of the file
2319
- *
2320
- * @example ```ts
2321
- *
2322
- * // build print image and launch downwnload of the file
2323
- * JMap.Application.Print.takeCapture()
2324
- * ```
2325
- */
2326
- function takeCapture(): void
2327
- }
2328
-
2329
- /**
2330
- * **JMap.Application.Query**
2331
- *
2332
- * You can manage everything related to query here.
2333
- */
2334
- namespace Query {
2335
- /**
2336
- * **JMap.Application.Query.activateQuery**
2337
- *
2338
- * Activates a query by id and group id.
2339
- *
2340
- * It displays the query form (replacing the list of queries) in the query panel.
2341
- *
2342
- * @param groupId the query group id
2343
- * @param queryId the query id
2344
- * @example ```ts
2345
- *
2346
- * // activate query id=43 on group id=23
2347
- * JMap.Application.Print.activateQuery(23, 43)
2348
- * ```
2349
- */
2350
- function activateQuery(groupId: JId, queryId: string): void
2351
-
2352
- /**
2353
- * **JMap.Application.Query.deactivateQuery**
2354
- *
2355
- * Deactivatea the current query. If no query is active, does nothing.
2356
- *
2357
- * If a query form is active (= its form is displayed), hidea it and returns to the query list.
2358
- *
2359
- * @example ```ts
2360
- *
2361
- * // if a query form is displayed, hide it and return to the query list.
2362
- * JMap.Application.Print.deactivateQuery()
2363
- * ```
2364
- */
2365
- function deactivateQuery(): void
2366
-
2367
- /**
2368
- * **JMap.Application.Query.getDefaultData**
2369
- *
2370
- * Returns the current query form data.
2371
- *
2372
- * If there is no active form, warns in the console and returns an empty object {}.
2473
+ * Builds a screen capture of the map and launches the download of the file, or returns the screen capture as a data url embeded in a {@link JAppPrintCaptureResult}
2474
+ * @param returnAsScreenCaptureResult if true, the method will resolve with a {@link JAppPrintCaptureResult} that you can use to embed the image in an HTML page, otherwise the method will resolve with no result
2475
+ * @param customRatioWidth The custom ratio width. When both customRatioWidth and customRatioHeight are specified, the captured image will be using a custom paper format having the aspect ratio defined by the specified width/height. returnAsScreenCaptureResult must be set to "true" for this parameter to be taken into account
2476
+ * @param customRatioHeight The custom ratio height. returnAsScreenCaptureResult must be set to "true" for this parameters to be taken into account
2373
2477
  *
2374
- * @example ```ts
2478
+ * When passing `returnAsScreenCaptureResult = true`, the screen capture process will take into account all Print parameters defined in the Print panel, including page format, scale, North arrow, title, sub-title, etc, but with the following limitations:
2375
2479
  *
2376
- * // returns the current query form data
2377
- * JMap.Application.Print.getDefaultData()
2378
- * ```
2379
- */
2380
- function getDefaultData(): { [id: string]: any }
2381
-
2382
- /**
2383
- * **JMap.Application.Query.setDefaultData**
2384
- *
2385
- * Sets active query form data. If there is no active form, this function throws.
2386
- *
2387
- * @throws if no query is active
2388
- * @param values the form data, depends on the form
2389
- * @example ```ts
2390
- *
2391
- * // set the current query form data
2392
- * JMap.Application.Print.setDefaultData({
2393
- * $param1: "black",
2394
- * $param2: "white"
2395
- * })
2396
- * ```
2397
- */
2398
- function setDefaultData(values: any): void
2399
-
2400
- /**
2401
- * **JMap.Application.Query.clearDefaultData**
2402
- *
2403
- * Resets the current query form data.
2404
- *
2405
- * If there is no active form, does nothing.
2406
- *
2407
- * @example ```ts
2408
- *
2409
- * // clear the current query form data
2410
- * JMap.Application.Print.clearDefaultData()
2411
- * ```
2412
- */
2413
- function clearDefaultData(): void
2414
-
2415
- /**
2416
- * **JMap.Application.Query.displayInDialog**
2480
+ * * the image format returned will always be PNG
2481
+ * * If you want the Print panel overlays be present in the screen capture, you must programaticaly switch to the Print panel before calling JMap.Application.Print.takeCapture(true), otherwise only the map will be captured
2417
2482
  *
2418
- * By default, the query form is displayed in the left panel with a simple layout, one field per line.
2419
2483
  *
2420
- * But it is possible to display it in a modal window, with the layout defined in the project.
2421
- *
2422
- * @throws if isVisibleInDialog is not a boolean
2423
- * @param isVisibleInDialog true in modal window, false in left panel
2424
- * @example ```ts
2425
- *
2426
- * // display the current form in a modal window
2427
- * JMap.Application.Print.displayInDialog(true)
2428
- *
2429
- * // display the current form in the left panel
2430
- * JMap.Application.Print.displayInDialog(false)
2431
- * ```
2432
- */
2433
- function displayInDialog(isVisibleInDialog: boolean): void
2434
-
2435
- /**
2436
- * **JMap.Application.Query.processQuery**
2437
- *
2438
- * Processes the active query form with the given values.
2439
- *
2440
- * Throws if no query is active.
2441
- *
2442
- * Resolves only if some features are found.
2443
- *
2444
- * If features are found, makes the layer selectable and visible if needed, then selects and zooms on found features.
2445
- *
2446
- * If no feature is found, the Promise rejects with a human readable error in the current user's locale.
2447
- *
2448
- * @throws if no query is active
2449
- * @param value the form data, depends on the form
2450
- * @example ```ts
2484
+ * @example
2485
+ * ```ts
2486
+ * // build print image and launch download of the file
2487
+ * JMap.Application.Print.takeCapture()
2451
2488
  *
2452
- * // display the current form in a modal window
2453
- * JMap.Application.Print
2454
- * .processQuery({
2455
- * $param1: "black",
2456
- * $param2: "white"
2457
- * })
2458
- * .then(features => console.info(`Found ${features.length} feature(s)`, features))
2459
- * .catch(error => {
2460
- * // pass here if no features are found, or other error
2461
- * // thrown error is a readable error using the user locale
2462
- * console.error(error)
2463
- * })
2489
+ * // add an image to a document with the print result
2490
+ * JMap.Application.Print.takeCapture(true, 400, 200).then(
2491
+ * printCaptureResult => {
2492
+ * const img = document.createElement("img")
2493
+ * img.src = printCaptureResult.dataUrl
2494
+ * img.style.position = "absolute"
2495
+ * img.width = printCaptureResult.width / 4
2496
+ * img.height = printCaptureResult.height / 4
2497
+ * img.style.top = "10px"
2498
+ * img.style.left = "10px"
2499
+ * img.style.zIndex = 1000
2500
+ * document.body.appendChild(img)
2501
+ * }
2502
+ * )
2464
2503
  * ```
2465
2504
  */
2466
- function processQuery(values: any): Promise<GeoJSON.Feature[]>
2505
+ function takeCapture(
2506
+ returnAsScreenCaptureResult?: boolean,
2507
+ customRatioWidth?: number,
2508
+ customRatioHeight?: number
2509
+ ): Promise<void | JAppPrintCaptureResult>
2467
2510
  }
2468
2511
 
2469
2512
  /**
@@ -2512,8 +2555,8 @@ declare namespace JMap {
2512
2555
  *
2513
2556
  * @param listenerId Your listener id (must be unique)
2514
2557
  * @param fn Your listener function
2515
- * @example ```ts
2516
- *
2558
+ * @example
2559
+ * ```ts
2517
2560
  * // log a message in the console once the application is loaded
2518
2561
  * JMap.Application.Event.Main.on.appReady(
2519
2562
  * "custom-app-ready",
@@ -2540,8 +2583,8 @@ declare namespace JMap {
2540
2583
  * If the listener is inactive, it will be reactivated and will be called again ...
2541
2584
  *
2542
2585
  * @param listenerId The listener id
2543
- * @example ```ts
2544
- *
2586
+ * @example
2587
+ * ```ts
2545
2588
  * // activate the listener "my-main-listener"
2546
2589
  * JMap.Application.Event.Main.activate("my-main-listener")
2547
2590
  * ```
@@ -2558,8 +2601,8 @@ declare namespace JMap {
2558
2601
  * If the listener is active, it will be deactivated and will be ignored ...
2559
2602
  *
2560
2603
  * @param listenerId The listener id
2561
- * @example ```ts
2562
- *
2604
+ * @example
2605
+ * ```ts
2563
2606
  * // deactivate the listener "my-main-listener"
2564
2607
  * JMap.Application.Event.Main.deactivate("my-main-listener")
2565
2608
  * ```
@@ -2576,8 +2619,8 @@ declare namespace JMap {
2576
2619
  * Removes the listener from JMap Cloud NG. The listener is deleted and never called again after that.
2577
2620
  *
2578
2621
  * @param listenerId The listener id
2579
- * @example ```ts
2580
- *
2622
+ * @example
2623
+ * ```ts
2581
2624
  * // remove the listener "my-main-listener"
2582
2625
  * JMap.Application.Event.Main.remove("my-main-listener")
2583
2626
  * ```
@@ -2608,8 +2651,8 @@ declare namespace JMap {
2608
2651
  *
2609
2652
  * @param listenerId Your listener id (must be unique)
2610
2653
  * @param fn Your listener function
2611
- * @example ```ts
2612
- *
2654
+ * @example
2655
+ * ```ts
2613
2656
  * // Triggered when a user double clicks on a layer name
2614
2657
  * JMap.Application.Event.Layer.on.doubleClick("my-layer-double-click-listener", params => {
2615
2658
  * const layer = params.layer
@@ -2635,8 +2678,8 @@ declare namespace JMap {
2635
2678
  * If the listener is inactive, it will be reactivated and will be called again ...
2636
2679
  *
2637
2680
  * @param listenerId The listener id
2638
- * @example ```ts
2639
- *
2681
+ * @example
2682
+ * ```ts
2640
2683
  * // activate the listener "my-layer-listener"
2641
2684
  * JMap.Application.Event.Layer.activate("my-layer-listener")
2642
2685
  * ```
@@ -2653,8 +2696,8 @@ declare namespace JMap {
2653
2696
  * If the listener is active, it will be deactivated and will be ignored ...
2654
2697
  *
2655
2698
  * @param listenerId The listener id
2656
- * @example ```ts
2657
- *
2699
+ * @example
2700
+ * ```ts
2658
2701
  * // deactivate the listener "my-layer-listener"
2659
2702
  * JMap.Application.Event.Layer.deactivate("my-layer-listener")
2660
2703
  * ```
@@ -2671,8 +2714,8 @@ declare namespace JMap {
2671
2714
  * Removes the listener from JMap Cloud NG. The listener is deleted and never called again after that.
2672
2715
  *
2673
2716
  * @param listenerId The listener id
2674
- * @example ```ts
2675
- *
2717
+ * @example
2718
+ * ```ts
2676
2719
  * // remove the listener "my-layer-listener"
2677
2720
  * JMap.Application.Event.Layer.remove("my-layer-listener")
2678
2721
  * ```
@@ -2703,8 +2746,8 @@ declare namespace JMap {
2703
2746
  *
2704
2747
  * @param listenerId Your listener id (must be unique)
2705
2748
  * @param fn Your listener function
2706
- * @example ```ts
2707
- *
2749
+ * @example
2750
+ * ```ts
2708
2751
  * // Triggered when a user register a new extension
2709
2752
  * JMap.Application.Event.Extension.on.registration("my-extension-listener", params => {
2710
2753
  * const extensionId = params.extensionId
@@ -2724,8 +2767,8 @@ declare namespace JMap {
2724
2767
  * If the listener is inactive, it will be reactivated and will be called again ...
2725
2768
  *
2726
2769
  * @param listenerId The listener id
2727
- * @example ```ts
2728
- *
2770
+ * @example
2771
+ * ```ts
2729
2772
  * // activate the listener "my-extension-listener"
2730
2773
  * JMap.Application.Event.Extension.activate("my-extension-listener")
2731
2774
  * ```
@@ -2742,8 +2785,8 @@ declare namespace JMap {
2742
2785
  * If the listener is active, it will be deactivated and will be ignored ...
2743
2786
  *
2744
2787
  * @param listenerId The listener id
2745
- * @example ```ts
2746
- *
2788
+ * @example
2789
+ * ```ts
2747
2790
  * // deactivate the listener "my-extension-listener"
2748
2791
  * JMap.Application.Event.Extension.deactivate("my-extension-listener")
2749
2792
  * ```
@@ -2760,8 +2803,8 @@ declare namespace JMap {
2760
2803
  * Removes the listener from JMap Cloud NG. The listener is deleted and never called again after that.
2761
2804
  *
2762
2805
  * @param listenerId The listener id
2763
- * @example ```ts
2764
- *
2806
+ * @example
2807
+ * ```ts
2765
2808
  * // remove the listener "my-extension-listener"
2766
2809
  * JMap.Application.Event.Extension.remove("my-extension-listener")
2767
2810
  * ```
@@ -2790,8 +2833,8 @@ declare namespace JMap {
2790
2833
  *
2791
2834
  * @param listenerId Your listener id (must be unique)
2792
2835
  * @param fn Your listener function
2793
- * @example ```ts
2794
- *
2836
+ * @example
2837
+ * ```ts
2795
2838
  * // log a message in the console when the side panel is closed or opened
2796
2839
  * JMap.Application.Event.UI.on.sidePanelVisibilityChanged(
2797
2840
  * "custom-side-panel-visibility-changed",
@@ -2811,8 +2854,8 @@ declare namespace JMap {
2811
2854
  *
2812
2855
  * @param listenerId Your listener id (must be unique)
2813
2856
  * @param fn Your listener function
2814
- * @example ```ts
2815
- *
2857
+ * @example
2858
+ * ```ts
2816
2859
  * // log a message in the console when the side panel width changes
2817
2860
  * JMap.Application.Event.UI.on.sidePanelWidthChanged(
2818
2861
  * "custom-side-panel-width-changed",
@@ -2836,8 +2879,8 @@ declare namespace JMap {
2836
2879
  * If the listener is inactive, it will be reactivated and will be called again ...
2837
2880
  *
2838
2881
  * @param listenerId The listener id
2839
- * @example ```ts
2840
- *
2882
+ * @example
2883
+ * ```ts
2841
2884
  * // activate the listener "my-ui-listener"
2842
2885
  * JMap.Application.Event.UI.activate("my-ui-listener")
2843
2886
  * ```
@@ -2854,8 +2897,8 @@ declare namespace JMap {
2854
2897
  * If the listener is active, it will be deactivated and will be ignored ...
2855
2898
  *
2856
2899
  * @param listenerId The listener id
2857
- * @example ```ts
2858
- *
2900
+ * @example
2901
+ * ```ts
2859
2902
  * // deactivate the listener "my-ui-listener"
2860
2903
  * JMap.Application.Event.UI.deactivate("my-ui-listener")
2861
2904
  * ```
@@ -2872,8 +2915,8 @@ declare namespace JMap {
2872
2915
  * Removes the listener from JMap Cloud NG. The listener is deleted and never called again after that.
2873
2916
  *
2874
2917
  * @param listenerId The listener id
2875
- * @example ```ts
2876
- *
2918
+ * @example
2919
+ * ```ts
2877
2920
  * // remove the listener "my-ui-listener"
2878
2921
  * JMap.Application.Event.UI.remove("my-ui-listener")
2879
2922
  * ```
@@ -2906,8 +2949,8 @@ declare namespace JMap {
2906
2949
  *
2907
2950
  * @param listenerId Your listener id (must be unique)
2908
2951
  * @param fn Your listener function
2909
- * @example ```ts
2910
- *
2952
+ * @example
2953
+ * ```ts
2911
2954
  * // Triggered after a map-context is applied
2912
2955
  * JMap.Application.Event.MapContext.on.afterApply("my-after-apply-listener", params => {
2913
2956
  * console.info(`After apply map context id="${params.context.title}"`, params.context)
@@ -2933,8 +2976,8 @@ declare namespace JMap {
2933
2976
  * If the listener is inactive, it will be reactivated and will be called again ...
2934
2977
  *
2935
2978
  * @param listenerId The listener id
2936
- * @example ```ts
2937
- *
2979
+ * @example
2980
+ * ```ts
2938
2981
  * // activate the listener "my-mapcontext-listener"
2939
2982
  * JMap.Application.Event.MapContext.activate("my-mapcontext-listener")
2940
2983
  * ```
@@ -2951,8 +2994,8 @@ declare namespace JMap {
2951
2994
  * If the listener is active, it will be deactivated and will be ignored ...
2952
2995
  *
2953
2996
  * @param listenerId The listener id
2954
- * @example ```ts
2955
- *
2997
+ * @example
2998
+ * ```ts
2956
2999
  * // deactivate the listener "my-mapcontext-listener"
2957
3000
  * JMap.Application.Event.MapContext.deactivate("my-mapcontext-listener")
2958
3001
  * ```
@@ -2969,8 +3012,8 @@ declare namespace JMap {
2969
3012
  * Remove the listener from JMap Cloud NG Core library. The listener is deleted and never called again after that.
2970
3013
  *
2971
3014
  * @param listenerId The listener id
2972
- * @example ```ts
2973
- *
3015
+ * @example
3016
+ * ```ts
2974
3017
  * // remove the listener "my-mapcontext-listener"
2975
3018
  * JMap.Application.Event.MapContext.remove("my-mapcontext-listener")
2976
3019
  * ```
@@ -2999,11 +3042,11 @@ declare namespace JMap {
2999
3042
  *
3000
3043
  * @param action : the action to add
3001
3044
  * @param index : will insert at a specific index in the menu. Start at 0. If index is not correct insert at the end
3002
- * @example ```ts
3003
- *
3045
+ * @example
3046
+ * ```ts
3004
3047
  * JMap.Application.User.addPopupMenuAction({
3005
3048
  * id: "my-unique-id",
3006
- * icon: "fas fa-info-circle",
3049
+ * icon: "https://link.to.my/image",
3007
3050
  * label: { key: "my.custom.menu.item.translation.key", bundleId: "myTranslationBundleId"}, // label can also be a simple string
3008
3051
  * isHelp: true, // if true will be displayed in the JMap help menu
3009
3052
  * onClick: () => window.open("https://link-to-my-documentation", "_blanck")
@@ -3019,8 +3062,8 @@ declare namespace JMap {
3019
3062
  *
3020
3063
  * @param actionId the action menu id
3021
3064
  * @throws if actionId is not a string (non empty)
3022
- * @example ```ts
3023
- *
3065
+ * @example
3066
+ * ```ts
3024
3067
  * // returns true if the action menu id="my-custom-action-menu" exists, else false
3025
3068
  * JMap.Application.User.existsPopupMenuActionById("my-custom-action-menu")
3026
3069
  * ```
@@ -3034,8 +3077,8 @@ declare namespace JMap {
3034
3077
  *
3035
3078
  * @param actionId the action menu id
3036
3079
  * @throws if actionId is not valid, or not found
3037
- * @example ```ts
3038
- *
3080
+ * @example
3081
+ * ```ts
3039
3082
  * // remove the action menu id="my-custom-action-menu"
3040
3083
  * JMap.Application.User.removePopupMenuActionById("my-custom-action-menu")
3041
3084
  * ```
@@ -3055,9 +3098,9 @@ declare namespace JMap {
3055
3098
  * Registers your own JMap Cloud NG extension.
3056
3099
  *
3057
3100
  * @throws Error if a parameter is not correct
3058
- * @param extensionModel The extension model
3059
- * @example ```ts
3060
- *
3101
+ * @param extension The extension
3102
+ * @example
3103
+ * ```ts
3061
3104
  * JMap.Application.Extension.register({
3062
3105
  * id: "MyExtension", // Unique id
3063
3106
  * initFn: () => {
@@ -3087,8 +3130,8 @@ declare namespace JMap {
3087
3130
  *
3088
3131
  * @throws Error if extensionId format is not correct
3089
3132
  * @param extensionId The extension id
3090
- * @example ```ts
3091
- *
3133
+ * @example
3134
+ * ```ts
3092
3135
  * // returns true if extension id="my-extension" is in use or not
3093
3136
  * JMap.Extension.isRegistered("my-extension")
3094
3137
  * ```
@@ -3102,8 +3145,8 @@ declare namespace JMap {
3102
3145
  *
3103
3146
  * Desn't list JMap Cloud NG Core extensions, only JMap Cloud NG extensions.
3104
3147
  *
3105
- * @example ```ts
3106
- *
3148
+ * @example
3149
+ * ```ts
3107
3150
  * // Could returns [ "my-first-extension", "my-second-extension" ]
3108
3151
  * JMap.Extension.getAllRegisteredIds()
3109
3152
  * ```
@@ -3124,8 +3167,8 @@ declare namespace JMap {
3124
3167
  *
3125
3168
  * @param message the text of the message
3126
3169
  * @param options a JAppMessageOptions object
3127
- * @example ```ts
3128
- *
3170
+ * @example
3171
+ * ```ts
3129
3172
  * const message = "This operation is not allowed"
3130
3173
  * JMap.Application.Message.error(message, { duration: 5000 })
3131
3174
  * ```
@@ -3139,8 +3182,8 @@ declare namespace JMap {
3139
3182
  *
3140
3183
  * @param message the text of the message
3141
3184
  * @param options a JAppMessageOptions object
3142
- * @example ```ts
3143
- *
3185
+ * @example
3186
+ * ```ts
3144
3187
  * const message = "This operation has no effect"
3145
3188
  * JMap.Application.Message.warning(message, { duration: 5000 })
3146
3189
  * ```
@@ -3154,8 +3197,8 @@ declare namespace JMap {
3154
3197
  *
3155
3198
  * @param message the text of the message
3156
3199
  * @param options a JAppMessageOptions object
3157
- * @example ```ts
3158
- *
3200
+ * @example
3201
+ * ```ts
3159
3202
  * const message = "You are here"
3160
3203
  * JMap.Application.Message.info(message, { duration: 5000 })
3161
3204
  * ```
@@ -3169,8 +3212,8 @@ declare namespace JMap {
3169
3212
  *
3170
3213
  * @param message the text of the message
3171
3214
  * @param options a JAppMessageOptions object
3172
- * @example ```ts
3173
- *
3215
+ * @example
3216
+ * ```ts
3174
3217
  * const message = "The operation was successful"
3175
3218
  * JMap.Application.Message.success(message, { duration: 5000 })
3176
3219
  * ```
@@ -3189,8 +3232,8 @@ declare namespace JMap {
3189
3232
  * The optional onCancel callback is called when the cancel button is clicked.
3190
3233
  *
3191
3234
  * @param params message parameters
3192
- * @example ```ts
3193
- *
3235
+ * @example
3236
+ * ```ts
3194
3237
  * JMap.Application.Message.confirmMessage({
3195
3238
  * message: "Are you sure to do a given action ?",
3196
3239
  * onSuccess: () => console.log(`The user is sure`),
@@ -3215,8 +3258,8 @@ declare namespace JMap {
3215
3258
  *
3216
3259
  * @param message the text of the message
3217
3260
  * @param options a JAppMessageOptions object
3218
- * @example ```ts
3219
- *
3261
+ * @example
3262
+ * ```ts
3220
3263
  * const message = "The operation has failed"
3221
3264
  * const level = "error"
3222
3265
  * JMap.Application.Message.display(message, { duration: 5000 , severity: level})
@@ -3242,8 +3285,8 @@ declare namespace JMap {
3242
3285
  * @param message the message to display
3243
3286
  * @throws if message is not a non empty string
3244
3287
  * @returns the message id, usefull when you display multiple messages at the same time, but want to close only one.
3245
- * @example ```ts
3246
- *
3288
+ * @example
3289
+ * ```ts
3247
3290
  * // display a waiting overlay, making the app unavailable for user as long it is displayed
3248
3291
  * const messageId = JMap.Application.Message.displayWaitingOverlay("Please wait, processing data")
3249
3292
  * // NG app is now unavailable for the user
@@ -3275,8 +3318,8 @@ declare namespace JMap {
3275
3318
  *
3276
3319
  * @param messageId the message to close
3277
3320
  * @throws if you pass a message id that is not found
3278
- * @example ```ts
3279
- *
3321
+ * @example
3322
+ * ```ts
3280
3323
  * // display a waiting overlay, making the app unavailable for user as long it is displayed
3281
3324
  * const messageId = JMap.Application.Message.displayWaitingOverlay("Please wait, processing data")
3282
3325
  * // NG app is now unavailable for the user
@@ -3307,101 +3350,49 @@ declare namespace JMap {
3307
3350
  */
3308
3351
  namespace Form {
3309
3352
  /**
3310
- * ***JMap.Application.Form.render***
3311
- *
3312
- * Renders a form with given params in a container.
3313
- *
3314
- * @param containerId id of the container where the form will be rendered
3315
- * @param formParams a JFormParams object
3316
- * @example ```ts
3317
- *
3318
- * // this example will show you how to create a custom form in an extension
3319
- * // it will render the form in the extension panel
3320
- * window.JMAP_OPTIONS = {
3321
- * ...
3322
- * application: {
3323
- * extensions: [{
3324
- * id: "test-form",
3325
- * panelTitle: "Test of form component API",
3326
- * initFn: () => {},
3327
- * onPanelCreation: panelContainerId => {
3328
- * document.getElementById(panelContainerId).style.padding = "1rem"
3329
- * // create a custom form in the extension panel container
3330
- * JMap.Application.Form.render(panelContainerId, {
3331
- * id: "search-form",
3332
- * schema: {
3333
- * properties: {
3334
- * name: {
3335
- * title: "Office Name",
3336
- * type: "string",
3337
- * isRequired: true,
3338
- * maxLength: 255
3339
- * },
3340
- * type: {
3341
- * title: "Office type",
3342
- * type: "number",
3343
- * // default: 2,
3344
- * enum: [1, 2, 3],
3345
- * enumNames: ["Local", "External", "Mixte"]
3346
- * }
3347
- * }
3348
- * },
3349
- * uiSchema: [
3350
- * {
3351
- * type: "Tab",
3352
- * controls: [
3353
- * {
3354
- * id: "name",
3355
- * label: "Office name",
3356
- * widget: "input",
3357
- * scope: "#/properties/name"
3358
- * },
3359
- * {
3360
- * id: "type",
3361
- * label: "Office type",
3362
- * widget: "select",
3363
- * scope: "#/properties/type"
3364
- * }
3365
- * ]
3366
- * }
3367
- * ],
3368
- * defaultValueById: { // defaultValueById is optional
3369
- * name: "default value",
3370
- * type: 2
3371
- * },
3372
- * validate: (values, formMetaData) => JMap.Form.validateData(formMetaData, JMap.Form.getPreparedData(formMetaData, values)),
3373
- * onSubmit: values => {
3374
- * // saving your data
3375
- * // return a string if an error occurred
3376
- * // return a promise, and the form will display a loading button until the promise resolved
3377
- * JMap.Application.Message.info(`Submitted values: ${JSON.stringify(values)}`)
3378
- * }
3379
- * })
3380
- * },
3381
- * onPanelDestroy: panelContainerId => {
3382
- * JMap.Application.Form.destroyByContainerId(panelContainerId)
3383
- * }
3384
- * }]
3353
+ * **JMap.Application.Form.openForm**
3354
+ *
3355
+ * Opens a form dialog in the application. Depending on the shape of `params`, this will open either:
3356
+ * - a layer-based form (when `layerId` is provided), or
3357
+ * - a table-based form (when `tableId` is provided).
3358
+ *
3359
+ * When opening a layer form:
3360
+ * - `layerId` is required.
3361
+ * - You can optionally pass `featureId` or a full `feature` (GeoJSON.Feature) to edit an existing feature.
3362
+ * - `isReadOnly` controls whether the form is editable.
3363
+ * - `onSubmit` (if provided) is called after the user submits the form.
3364
+ *
3365
+ * When opening a table form:
3366
+ * - `tableId` is required.
3367
+ * - You can optionally pass `row` (an object of key/value pairs) to edit an existing row.
3368
+ * - `isReadOnly` controls whether the form is editable.
3369
+ * - `onSubmit` (if provided) is called after the user submits the form.
3370
+ *
3371
+ * @param params The parameters that configure which form to open:
3372
+ * - For a **layer form**:
3373
+ * - `layerId` (string): The ID of the layer to open the form for.
3374
+ * - `featureId?` (string): (Optional) The ID of the feature in that layer to load.
3375
+ * - `feature?` (GeoJSON.Feature): (Optional) A full GeoJSON feature to load instead of just an ID.
3376
+ * - For a **table form**:
3377
+ * - `tableId` (string): The ID of the table to open the form for.
3378
+ * - `row?` ({ [key: string]: any }): (Optional) The row data to load into the form.
3379
+ * - Common to both shapes:
3380
+ * - `isReadOnly` (boolean): If `true`, the form will be displayed in read‐only mode.
3381
+ * - `onSubmit?` (() => void): (Optional) Callback invoked after the form is successfully submitted.
3382
+ * @example
3383
+ * ```ts
3384
+ * // Example: Open a layer form for editing an existing feature
3385
+ * formSVC.openForm({
3386
+ * layerId: "db4bc79b-03fe-4cf7-a4bc-fb76d69cabdf",
3387
+ * featureId: "3022",
3388
+ * isReadOnly: false,
3389
+ * onSubmit: () => {
3390
+ * console.log("Layer form submitted successfully");
3385
3391
  * }
3386
- * }
3387
- * ```
3388
- *
3389
- */
3390
- function render(containerId: string, formParams: JFormParams): JFormMetaData
3391
-
3392
- /**
3393
- *
3394
- * ***JMap.Application.Form.destroyByContainerId***
3395
- *
3396
- * Unmounts form by using container Id where it was rendered
3397
- *
3398
- * @param containerId id of the container to unmount
3399
- * @example ```ts
3400
- *
3401
- * JMap.Application.Form.destroy("new-form")
3392
+ * });
3402
3393
  * ```
3403
3394
  */
3404
- function destroyByContainerId(containerId: string): void
3395
+ function openForm(params: JFormDialogParams): void
3405
3396
  }
3406
3397
  }
3407
3398
  }