@mapcomponents/react-maplibre 0.1.49 → 0.1.51

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/coverage/clover.xml +86 -86
  3. package/coverage/coverage-final.json +3 -3
  4. package/coverage/lcov-report/index.html +1 -1
  5. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
  6. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  7. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  8. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  9. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
  10. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  11. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  17. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
  18. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +26 -11
  19. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  20. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  21. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  22. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  23. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  24. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  29. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  30. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  31. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  33. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  39. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  41. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  42. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  43. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  44. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  46. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
  48. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  49. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  50. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  51. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +22 -19
  52. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  54. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  56. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  60. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
  62. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  63. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
  64. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  65. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  66. package/coverage/lcov-report/src/contexts/index.html +1 -1
  67. package/coverage/lcov-report/src/hooks/index.html +1 -1
  68. package/coverage/lcov-report/src/hooks/useLayer.ts.html +19 -10
  69. package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
  70. package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
  71. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  72. package/coverage/lcov-report/src/index.html +1 -1
  73. package/coverage/lcov-report/src/index.ts.html +1 -1
  74. package/coverage/lcov.info +185 -185
  75. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +3 -2
  76. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +15 -8
  77. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +22 -17
  78. package/dist/hooks/useLayer.d.ts +7 -5
  79. package/dist/index.esm.js.map +1 -1
  80. package/package.json +1 -1
  81. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +4 -3
  82. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +14 -9
  83. package/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.ts +2 -1
  84. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +18 -17
  85. package/src/hooks/useLayer.ts +11 -8
@@ -1075,24 +1075,24 @@ BRH:1
1075
1075
  end_of_record
1076
1076
  TN:
1077
1077
  SF:src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx
1078
- FN:78,(anonymous_0)
1078
+ FN:83,(anonymous_0)
1079
1079
  FNF:1
1080
1080
  FNH:1
1081
1081
  FNDA:32,(anonymous_0)
1082
- DA:78,11
1083
- DA:79,32
1084
- DA:81,32
1085
- DA:102,32
1082
+ DA:83,11
1083
+ DA:84,32
1084
+ DA:86,32
1085
+ DA:107,32
1086
1086
  LF:4
1087
1087
  LH:4
1088
- BRDA:79,0,0,32
1089
- BRDA:79,0,1,0
1090
- BRDA:83,1,0,32
1091
- BRDA:83,1,1,32
1092
- BRDA:87,2,0,32
1093
- BRDA:87,2,1,32
1094
- BRDA:92,3,0,32
1095
- BRDA:92,3,1,32
1088
+ BRDA:84,0,0,32
1089
+ BRDA:84,0,1,0
1090
+ BRDA:88,1,0,32
1091
+ BRDA:88,1,1,32
1092
+ BRDA:92,2,0,32
1093
+ BRDA:92,2,1,32
1094
+ BRDA:97,3,0,32
1095
+ BRDA:97,3,1,32
1096
1096
  BRF:8
1097
1097
  BRH:7
1098
1098
  end_of_record
@@ -2508,13 +2508,13 @@ BRH:15
2508
2508
  end_of_record
2509
2509
  TN:
2510
2510
  SF:src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx
2511
- FN:79,(anonymous_0)
2512
- FN:99,(anonymous_1)
2513
- FN:100,(anonymous_2)
2514
- FN:108,(anonymous_3)
2515
- FN:123,(anonymous_4)
2516
- FN:140,(anonymous_5)
2517
- FN:153,(anonymous_6)
2511
+ FN:80,(anonymous_0)
2512
+ FN:100,(anonymous_1)
2513
+ FN:101,(anonymous_2)
2514
+ FN:109,(anonymous_3)
2515
+ FN:124,(anonymous_4)
2516
+ FN:141,(anonymous_5)
2517
+ FN:154,(anonymous_6)
2518
2518
  FNF:7
2519
2519
  FNH:6
2520
2520
  FNDA:12,(anonymous_0)
@@ -2524,66 +2524,66 @@ FNDA:0,(anonymous_3)
2524
2524
  FNDA:8,(anonymous_4)
2525
2525
  FNDA:4,(anonymous_5)
2526
2526
  FNDA:8,(anonymous_6)
2527
- DA:11,10
2528
- DA:79,10
2529
- DA:80,12
2530
- DA:82,12
2531
- DA:86,12
2532
- DA:89,12
2527
+ DA:12,10
2528
+ DA:80,10
2529
+ DA:81,12
2530
+ DA:83,12
2531
+ DA:87,12
2533
2532
  DA:90,12
2534
2533
  DA:91,12
2535
2534
  DA:92,12
2536
2535
  DA:93,12
2537
2536
  DA:94,12
2538
2537
  DA:95,12
2539
- DA:99,12
2540
- DA:100,4
2541
- DA:102,2
2542
- DA:103,0
2543
- DA:108,12
2544
- DA:109,0
2545
- DA:123,12
2546
- DA:124,8
2547
- DA:126,0
2548
- DA:131,0
2538
+ DA:96,12
2539
+ DA:100,12
2540
+ DA:101,4
2541
+ DA:103,2
2542
+ DA:104,0
2543
+ DA:109,12
2544
+ DA:110,0
2545
+ DA:124,12
2546
+ DA:125,8
2547
+ DA:127,0
2549
2548
  DA:132,0
2550
2549
  DA:133,0
2551
2550
  DA:134,0
2552
2551
  DA:135,0
2553
- DA:137,0
2554
- DA:140,12
2555
- DA:141,4
2556
- DA:148,0
2552
+ DA:136,0
2553
+ DA:138,0
2554
+ DA:141,12
2555
+ DA:142,4
2557
2556
  DA:149,0
2558
- DA:153,12
2559
- DA:154,8
2560
- DA:156,4
2561
- DA:158,4
2562
- DA:161,12
2557
+ DA:150,0
2558
+ DA:154,12
2559
+ DA:155,8
2560
+ DA:157,4
2561
+ DA:159,4
2562
+ DA:162,12
2563
2563
  LF:36
2564
2564
  LH:25
2565
- BRDA:102,0,0,0
2566
- BRDA:102,0,1,2
2567
- BRDA:124,1,0,8
2568
- BRDA:124,1,1,0
2569
- BRDA:124,2,0,8
2570
- BRDA:124,2,1,4
2571
- BRDA:126,3,0,0
2572
- BRDA:126,3,1,0
2573
- BRDA:127,4,0,0
2574
- BRDA:127,4,1,0
2575
- BRDA:127,4,2,0
2576
- BRDA:141,5,0,0
2577
- BRDA:141,5,1,4
2578
- BRDA:142,6,0,4
2579
- BRDA:142,6,1,4
2580
- BRDA:142,6,2,0
2581
- BRDA:142,6,3,0
2582
- BRDA:142,6,4,0
2583
- BRDA:154,7,0,4
2584
- BRDA:154,7,1,4
2585
- BRDA:154,8,0,8
2586
- BRDA:154,8,1,4
2565
+ BRDA:103,0,0,0
2566
+ BRDA:103,0,1,2
2567
+ BRDA:125,1,0,8
2568
+ BRDA:125,1,1,0
2569
+ BRDA:125,2,0,8
2570
+ BRDA:125,2,1,4
2571
+ BRDA:127,3,0,0
2572
+ BRDA:127,3,1,0
2573
+ BRDA:128,4,0,0
2574
+ BRDA:128,4,1,0
2575
+ BRDA:128,4,2,0
2576
+ BRDA:142,5,0,0
2577
+ BRDA:142,5,1,4
2578
+ BRDA:143,6,0,4
2579
+ BRDA:143,6,1,4
2580
+ BRDA:143,6,2,0
2581
+ BRDA:143,6,3,0
2582
+ BRDA:143,6,4,0
2583
+ BRDA:155,7,0,4
2584
+ BRDA:155,7,1,4
2585
+ BRDA:155,8,0,8
2586
+ BRDA:155,8,1,4
2587
2587
  BRF:22
2588
2588
  BRH:11
2589
2589
  end_of_record
@@ -3186,14 +3186,14 @@ BRH:14
3186
3186
  end_of_record
3187
3187
  TN:
3188
3188
  SF:src/hooks/useLayer.ts
3189
- FN:42,useLayer
3190
- FN:59,(anonymous_1)
3191
- FN:108,(anonymous_2)
3192
- FN:122,(anonymous_3)
3193
- FN:137,(anonymous_4)
3194
- FN:144,(anonymous_5)
3195
- FN:179,(anonymous_6)
3196
- FN:180,(anonymous_7)
3189
+ FN:45,useLayer
3190
+ FN:62,(anonymous_1)
3191
+ FN:111,(anonymous_2)
3192
+ FN:125,(anonymous_3)
3193
+ FN:140,(anonymous_4)
3194
+ FN:147,(anonymous_5)
3195
+ FN:182,(anonymous_6)
3196
+ FN:183,(anonymous_7)
3197
3197
  FNF:8
3198
3198
  FNH:7
3199
3199
  FNDA:102,useLayer
@@ -3204,126 +3204,126 @@ FNDA:49,(anonymous_4)
3204
3204
  FNDA:102,(anonymous_5)
3205
3205
  FNDA:23,(anonymous_6)
3206
3206
  FNDA:10,(anonymous_7)
3207
- DA:30,13
3208
- DA:43,102
3209
- DA:48,102
3210
- DA:49,102
3211
- DA:50,102
3207
+ DA:33,13
3208
+ DA:46,102
3209
+ DA:51,102
3212
3210
  DA:52,102
3213
- DA:54,102
3211
+ DA:53,102
3214
3212
  DA:55,102
3215
- DA:59,102
3216
- DA:60,26
3217
- DA:62,26
3218
- DA:63,3
3213
+ DA:57,102
3214
+ DA:58,102
3215
+ DA:62,102
3216
+ DA:63,26
3219
3217
  DA:65,26
3220
- DA:66,0
3218
+ DA:66,3
3221
3219
  DA:68,26
3222
- DA:70,26
3223
- DA:91,26
3224
- DA:93,26
3225
- DA:94,6
3226
- DA:97,26
3227
- DA:98,4
3228
- DA:101,26
3229
- DA:102,2
3230
- DA:106,26
3231
- DA:109,0
3232
- DA:110,0
3233
- DA:111,0
3234
- DA:117,26
3235
- DA:118,26
3236
- DA:119,26
3237
- DA:122,102
3238
- DA:123,102
3239
- DA:125,56
3240
- DA:131,30
3241
- DA:134,26
3242
- DA:137,102
3243
- DA:138,49
3244
- DA:141,12
3245
- DA:144,102
3246
- DA:145,102
3247
- DA:151,46
3248
- DA:155,56
3249
- DA:156,56
3250
- DA:157,0
3251
- DA:159,0
3220
+ DA:69,0
3221
+ DA:71,26
3222
+ DA:73,26
3223
+ DA:94,26
3224
+ DA:96,26
3225
+ DA:97,6
3226
+ DA:100,26
3227
+ DA:101,4
3228
+ DA:104,26
3229
+ DA:105,2
3230
+ DA:109,26
3231
+ DA:112,0
3232
+ DA:113,0
3233
+ DA:114,0
3234
+ DA:120,26
3235
+ DA:121,26
3236
+ DA:122,26
3237
+ DA:125,102
3238
+ DA:126,102
3239
+ DA:128,56
3240
+ DA:134,30
3241
+ DA:137,26
3242
+ DA:140,102
3243
+ DA:141,49
3244
+ DA:144,12
3245
+ DA:147,102
3246
+ DA:148,102
3247
+ DA:154,46
3248
+ DA:158,56
3249
+ DA:159,56
3252
3250
  DA:160,0
3253
- DA:161,0
3251
+ DA:162,0
3252
+ DA:163,0
3254
3253
  DA:164,0
3255
- DA:167,56
3256
- DA:168,56
3257
- DA:169,0
3258
- DA:170,0
3259
- DA:171,0
3254
+ DA:167,0
3255
+ DA:170,56
3256
+ DA:171,56
3260
3257
  DA:172,0
3258
+ DA:173,0
3259
+ DA:174,0
3261
3260
  DA:175,0
3262
- DA:179,102
3263
- DA:180,23
3264
- DA:181,10
3265
- DA:182,10
3266
- DA:186,102
3261
+ DA:178,0
3262
+ DA:182,102
3263
+ DA:183,23
3264
+ DA:184,10
3265
+ DA:185,10
3266
+ DA:189,102
3267
3267
  LF:60
3268
3268
  LH:46
3269
- BRDA:56,0,0,102
3270
- BRDA:56,0,1,20
3271
- BRDA:56,1,0,20
3272
- BRDA:56,1,1,0
3273
- BRDA:60,2,0,0
3274
- BRDA:60,2,1,26
3275
- BRDA:62,3,0,3
3276
- BRDA:62,3,1,23
3277
- BRDA:65,4,0,0
3278
- BRDA:65,4,1,26
3279
- BRDA:73,5,0,8
3280
- BRDA:73,5,1,18
3281
- BRDA:83,6,0,0
3282
- BRDA:83,6,1,26
3283
- BRDA:85,7,0,2
3284
- BRDA:85,7,1,24
3285
- BRDA:93,8,0,6
3286
- BRDA:93,8,1,20
3287
- BRDA:97,9,0,4
3288
- BRDA:97,9,1,22
3289
- BRDA:101,10,0,2
3290
- BRDA:101,10,1,24
3291
- BRDA:109,11,0,0
3292
- BRDA:109,11,1,0
3293
- BRDA:109,12,0,0
3294
- BRDA:109,12,1,0
3295
- BRDA:123,13,0,46
3296
- BRDA:123,13,1,56
3297
- BRDA:125,14,0,30
3298
- BRDA:125,14,1,26
3299
- BRDA:126,15,0,56
3300
- BRDA:126,15,1,33
3301
- BRDA:126,15,2,33
3302
- BRDA:126,15,3,33
3303
- BRDA:138,16,0,37
3304
- BRDA:138,16,1,12
3305
- BRDA:138,17,0,49
3306
- BRDA:138,17,1,26
3307
- BRDA:145,18,0,46
3308
- BRDA:145,18,1,56
3309
- BRDA:146,19,0,102
3310
- BRDA:146,19,1,56
3311
- BRDA:146,19,2,56
3312
- BRDA:146,19,3,56
3313
- BRDA:156,20,0,0
3314
- BRDA:156,20,1,56
3315
- BRDA:156,21,0,56
3316
- BRDA:156,21,1,40
3317
- BRDA:160,22,0,0
3318
- BRDA:160,22,1,0
3319
- BRDA:160,23,0,0
3320
- BRDA:160,23,1,0
3321
- BRDA:168,24,0,0
3322
- BRDA:168,24,1,56
3323
- BRDA:171,25,0,0
3324
- BRDA:171,25,1,0
3325
- BRDA:171,26,0,0
3326
- BRDA:171,26,1,0
3269
+ BRDA:59,0,0,102
3270
+ BRDA:59,0,1,20
3271
+ BRDA:59,1,0,20
3272
+ BRDA:59,1,1,0
3273
+ BRDA:63,2,0,0
3274
+ BRDA:63,2,1,26
3275
+ BRDA:65,3,0,3
3276
+ BRDA:65,3,1,23
3277
+ BRDA:68,4,0,0
3278
+ BRDA:68,4,1,26
3279
+ BRDA:76,5,0,8
3280
+ BRDA:76,5,1,18
3281
+ BRDA:86,6,0,0
3282
+ BRDA:86,6,1,26
3283
+ BRDA:88,7,0,2
3284
+ BRDA:88,7,1,24
3285
+ BRDA:96,8,0,6
3286
+ BRDA:96,8,1,20
3287
+ BRDA:100,9,0,4
3288
+ BRDA:100,9,1,22
3289
+ BRDA:104,10,0,2
3290
+ BRDA:104,10,1,24
3291
+ BRDA:112,11,0,0
3292
+ BRDA:112,11,1,0
3293
+ BRDA:112,12,0,0
3294
+ BRDA:112,12,1,0
3295
+ BRDA:126,13,0,46
3296
+ BRDA:126,13,1,56
3297
+ BRDA:128,14,0,30
3298
+ BRDA:128,14,1,26
3299
+ BRDA:129,15,0,56
3300
+ BRDA:129,15,1,33
3301
+ BRDA:129,15,2,33
3302
+ BRDA:129,15,3,33
3303
+ BRDA:141,16,0,37
3304
+ BRDA:141,16,1,12
3305
+ BRDA:141,17,0,49
3306
+ BRDA:141,17,1,26
3307
+ BRDA:148,18,0,46
3308
+ BRDA:148,18,1,56
3309
+ BRDA:149,19,0,102
3310
+ BRDA:149,19,1,56
3311
+ BRDA:149,19,2,56
3312
+ BRDA:149,19,3,56
3313
+ BRDA:159,20,0,0
3314
+ BRDA:159,20,1,56
3315
+ BRDA:159,21,0,56
3316
+ BRDA:159,21,1,40
3317
+ BRDA:163,22,0,0
3318
+ BRDA:163,22,1,0
3319
+ BRDA:163,23,0,0
3320
+ BRDA:163,23,1,0
3321
+ BRDA:171,24,0,0
3322
+ BRDA:171,24,1,56
3323
+ BRDA:174,25,0,0
3324
+ BRDA:174,25,1,0
3325
+ BRDA:174,26,0,0
3326
+ BRDA:174,26,1,0
3327
3327
  BRF:58
3328
3328
  BRH:40
3329
3329
  end_of_record
@@ -1,4 +1,5 @@
1
- import { Map, IControl, MapOptions as MapOptionsType } from "!maplibre-gl";
1
+ import { IControl, MapOptions as MapOptionsType } from "!maplibre-gl";
2
+ import { Map as MapType } from "maplibre-gl";
2
3
  declare type EventArgArray = [string, string | Function, Function?];
3
4
  declare type LayerState = {
4
5
  id: string;
@@ -57,7 +58,7 @@ declare class MapLibreGlWrapper {
57
58
  };
58
59
  initRegisteredElements: Function;
59
60
  addNativeMaplibreFunctionsAndProps: Function;
60
- map: Map;
61
+ map: MapType;
61
62
  style: object;
62
63
  styleJson: object;
63
64
  addLayer: Function;
@@ -1,4 +1,5 @@
1
1
  import { Feature, FeatureCollection } from "@turf/turf";
2
+ import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, MapLayerMouseEvent } from "maplibre-gl";
2
3
  declare type MlGeoJsonLayerProps = {
3
4
  /**
4
5
  * Id of the target MapLibre instance in mapContext
@@ -7,6 +8,8 @@ declare type MlGeoJsonLayerProps = {
7
8
  /**
8
9
  * Id of an existing layer in the mapLibre instance to help specify the layer order
9
10
  * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
11
+ * This layer will not be added to the maplibre-gl instance until a layer with an
12
+ * id that matches the value of insertBeforeLayer is created.
10
13
  */
11
14
  insertBeforeLayer?: string;
12
15
  /**
@@ -21,7 +24,7 @@ declare type MlGeoJsonLayerProps = {
21
24
  * Type of the layer that will be added to the MapLibre instance.
22
25
  * Possible values: "line", "circle", "fill"
23
26
  */
24
- type?: string;
27
+ type?: "fill" | "line" | "circle";
25
28
  /**
26
29
  * Paint property object, that is passed to the addLayer call.
27
30
  * Possible props depend on the layer type.
@@ -29,7 +32,7 @@ declare type MlGeoJsonLayerProps = {
29
32
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
30
33
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
31
34
  */
32
- paint?: any;
35
+ paint?: CircleLayerSpecification['paint'] | FillLayerSpecification['paint'] | LineLayerSpecification['layout'];
33
36
  /**
34
37
  * Layout property object, that is passed to the addLayer call.
35
38
  * Possible props depend on the layer type.
@@ -37,28 +40,32 @@ declare type MlGeoJsonLayerProps = {
37
40
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
38
41
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
39
42
  */
40
- layout?: any;
43
+ layout?: CircleLayerSpecification['layout'] | FillLayerSpecification['layout'] | LineLayerSpecification['layout'];
41
44
  /**
42
45
  * Javascript object that is spread into the addLayer commands first parameter.
43
46
  */
44
- options?: any;
47
+ options?: CircleLayerSpecification | FillLayerSpecification | LineLayerSpecification;
45
48
  /**
46
49
  * Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
47
50
  */
48
- defaultPaintOverrides?: any;
51
+ defaultPaintOverrides?: {
52
+ circle?: CircleLayerSpecification['paint'];
53
+ fill?: FillLayerSpecification['paint'];
54
+ line?: LineLayerSpecification['paint'];
55
+ };
49
56
  /**
50
57
  * Hover event handler that is executed whenever a geometry rendered by this component is hovered.
51
58
  */
52
- onHover?: Function;
59
+ onHover?: MapLayerMouseEvent;
53
60
  /**
54
61
  * Click event handler that is executed whenever a geometry rendered by this component is clicked.
55
62
  */
56
- onClick?: Function;
63
+ onClick?: MapLayerMouseEvent;
57
64
  /**
58
65
  * Leave event handler that is executed whenever a geometry rendered by this component is
59
66
  * left/unhovered.
60
67
  */
61
- onLeave?: Function;
68
+ onLeave?: MapLayerMouseEvent;
62
69
  };
63
70
  /**
64
71
  * Adds source and layer of types "line", "fill" or "circle" to display GeoJSON data on the map.
@@ -1,60 +1,65 @@
1
1
  import { Feature, FeatureCollection } from "@turf/turf";
2
+ import { CircleLayerSpecification, FillLayerSpecification, LineLayerSpecification, MapLayerMouseEvent } from "maplibre-gl";
2
3
  interface MlTransitionGeoJsonLayerProps {
3
4
  /**
4
5
  * Id of the target MapLibre instance in mapContext
5
6
  */
6
7
  mapId: string;
8
+ /**
9
+ * GeoJSON data that is supposed to be rendered by this component.
10
+ */
11
+ geojson: Feature | FeatureCollection | undefined;
7
12
  /**
8
13
  * Type of the layer that will be added to the MapLibre instance.
9
14
  * Possible values: "line", "circle", "fill"
10
15
  */
11
- type: string;
16
+ type?: "fill" | "line" | "circle";
12
17
  /**
13
- * Layout property object, that is passed to the addLayer call.
18
+ * Paint property object, that is passed to the addLayer call.
14
19
  * Possible props depend on the layer type.
15
20
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
16
21
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
17
22
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
18
23
  */
19
- layout: any;
24
+ paint?: CircleLayerSpecification['paint'] | FillLayerSpecification['paint'] | LineLayerSpecification['layout'];
20
25
  /**
21
- * Paint property object, that is passed to the addLayer call.
26
+ * Layout property object, that is passed to the addLayer call.
22
27
  * Possible props depend on the layer type.
23
28
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
24
29
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
25
30
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
26
31
  */
27
- paint: any;
28
- /**
29
- * Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
30
- */
31
- defaultPaintOverrides: any;
32
+ layout?: CircleLayerSpecification['layout'] | FillLayerSpecification['layout'] | LineLayerSpecification['layout'];
32
33
  /**
33
34
  * Javascript object that is spread into the addLayer commands first parameter.
34
35
  */
35
- options: any;
36
+ options?: CircleLayerSpecification | FillLayerSpecification | LineLayerSpecification;
36
37
  /**
37
- * GeoJSON data that is supposed to be rendered by this component.
38
+ * Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
38
39
  */
39
- geojson: Feature | FeatureCollection;
40
+ defaultPaintOverrides?: {
41
+ circle?: CircleLayerSpecification['paint'];
42
+ fill?: FillLayerSpecification['paint'];
43
+ line?: LineLayerSpecification['paint'];
44
+ };
40
45
  /**
41
46
  * Id of an existing layer in the mapLibre instance to help specify the layer order
42
47
  * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
43
48
  */
44
49
  insertBeforeLayer: string;
45
50
  /**
46
- * Click event handler that is executed whenever a geometry rendered by this component is clicked.
51
+ * Hover event handler that is executed whenever a geometry rendered by this component is hovered.
47
52
  */
48
- onClick: Function;
53
+ onHover?: MapLayerMouseEvent;
49
54
  /**
50
- * Hover event handler that is executed whenever a geometry rendered by this component is hovered.
55
+ * Click event handler that is executed whenever a geometry rendered by this component is clicked.
51
56
  */
52
- onHover: Function;
57
+ onClick?: MapLayerMouseEvent;
53
58
  /**
54
59
  * Leave event handler that is executed whenever a geometry rendered by this component is
55
60
  * left/unhovered.
56
61
  */
57
- onLeave: Function;
62
+ onLeave?: MapLayerMouseEvent;
58
63
  /**
59
64
  * Creates transition animation whenever the geojson prop changes.
60
65
  * Only works with layer type "line" and LineString GeoJSON data.
@@ -1,6 +1,8 @@
1
1
  import { useMapType } from "./useMap";
2
2
  import { LayerSpecification } from "maplibre-gl";
3
3
  import MapLibreGlWrapper from "../components/MapLibreMap/lib/MapLibreGlWrapper";
4
+ import { MapLayerMouseEvent } from "maplibre-gl";
5
+ import { GeoJSONObject } from "@turf/turf";
4
6
  declare type useLayerType = {
5
7
  map: MapLibreGlWrapper | undefined;
6
8
  layer: LayerSpecification;
@@ -14,11 +16,11 @@ interface useLayerProps {
14
16
  idPrefix?: string;
15
17
  insertBeforeLayer?: string;
16
18
  insertBeforeFirstSymbolLayer?: boolean;
17
- geojson?: object;
18
- options: LayerSpecification;
19
- onHover?: Function;
20
- onClick?: Function;
21
- onLeave?: Function;
19
+ geojson?: GeoJSONObject;
20
+ options: Partial<LayerSpecification>;
21
+ onHover?: MapLayerMouseEvent;
22
+ onClick?: MapLayerMouseEvent;
23
+ onLeave?: MapLayerMouseEvent;
22
24
  }
23
25
  declare function useLayer(props: useLayerProps): useLayerType;
24
26
  export default useLayer;