@aguacerowx/react-native 0.0.52 → 0.0.54
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/LICENSE +21 -0
- package/android/src/main/cpp/satellite_ktx_jni.cpp +6 -1
- package/android/src/main/java/com/aguacerowx/reactnative/NexradRadarLayerView.java +14 -2
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayer.java +121 -1
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayerView.java +556 -392
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +77 -0
- package/index.js +1 -1
- package/ios/SatelliteLayerView.swift +517 -517
- package/ios/WeatherFrameProcessorModule.m +19 -15
- package/ios/WeatherFrameProcessorModule.swift +65 -0
- package/lib/commonjs/AguaceroContext.js +0 -4
- package/lib/commonjs/AguaceroContext.js.map +1 -1
- package/lib/commonjs/GridRenderLayer.js +62 -76
- package/lib/commonjs/GridRenderLayer.js.map +1 -1
- package/lib/commonjs/MapManager.js +110 -224
- package/lib/commonjs/MapManager.js.map +1 -1
- package/lib/commonjs/MapRegistry.js +21 -33
- package/lib/commonjs/MapRegistry.js.map +1 -1
- package/lib/commonjs/NexradRadarLayer.android.js +28 -100
- package/lib/commonjs/NexradRadarLayer.android.js.map +1 -1
- package/lib/commonjs/NexradRadarLayer.ios.js +26 -97
- package/lib/commonjs/NexradRadarLayer.ios.js.map +1 -1
- package/lib/commonjs/NexradSitesMapLayer.js +41 -61
- package/lib/commonjs/NexradSitesMapLayer.js.map +1 -1
- package/lib/commonjs/SatelliteLayer.android.js +26 -38
- package/lib/commonjs/SatelliteLayer.android.js.map +1 -1
- package/lib/commonjs/SatelliteLayer.ios.js +30 -42
- package/lib/commonjs/SatelliteLayer.ios.js.map +1 -1
- package/lib/commonjs/StyleApplicator.js +129 -175
- package/lib/commonjs/StyleApplicator.js.map +1 -1
- package/lib/commonjs/WeatherLayerManager.js +996 -1627
- package/lib/commonjs/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/aguaceroCoreDebugHooks.js +58 -130
- package/lib/commonjs/aguaceroCoreDebugHooks.js.map +1 -1
- package/lib/commonjs/aguaceroRnDebug.js +147 -287
- package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
- package/lib/commonjs/cdnAuthenticatedFetch.js +104 -0
- package/lib/commonjs/cdnAuthenticatedFetch.js.map +1 -0
- package/lib/commonjs/dispatchViewManagerCommandCompat.js +51 -88
- package/lib/commonjs/dispatchViewManagerCommandCompat.js.map +1 -1
- package/lib/commonjs/gridCdnAuth.js +41 -50
- package/lib/commonjs/gridCdnAuth.js.map +1 -1
- package/lib/commonjs/index.js +51 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nexrad/nexradAndroidController.js +851 -863
- package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
- package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/nexradDiag.js +32 -148
- package/lib/commonjs/nexrad/nexradDiag.js.map +1 -1
- package/lib/commonjs/nexrad/nexradLevel2Keys.js +261 -0
- package/lib/commonjs/nexrad/nexradLevel2Keys.js.map +1 -0
- package/lib/commonjs/nexrad/nexradLutBuild.js +64 -111
- package/lib/commonjs/nexrad/nexradLutBuild.js.map +1 -1
- package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js +136 -164
- package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/nexradSdkImports.js +51 -0
- package/lib/commonjs/nexrad/nexradSdkImports.js.map +1 -0
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js +2848 -4455
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/radarDecode.worker.bundled.js +445 -648
- package/lib/commonjs/nexrad/radarDecode.worker.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js +52 -68
- package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
- package/lib/commonjs/nexradNativeCommandIds.js +24 -0
- package/lib/commonjs/nexradNativeCommandIds.js.map +1 -0
- package/lib/commonjs/nws/NwsAlertsOverlay.android.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.ios.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.js +3 -3
- package/lib/commonjs/nws/NwsAlertsOverlay.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.native.js +235 -361
- package/lib/commonjs/nws/NwsAlertsOverlay.native.js.map +1 -1
- package/lib/commonjs/nws/eventSourceRnPolyfill.js +92 -146
- package/lib/commonjs/nws/eventSourceRnPolyfill.js.map +1 -1
- package/lib/commonjs/nws/nwsAndroidConstants.js +2 -8
- package/lib/commonjs/nws/nwsAndroidConstants.js.map +1 -1
- package/lib/commonjs/satellite/satelliteAndroidController.js +122 -199
- package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/commonjs/satelliteBridgeDiag.js +3 -13
- package/lib/commonjs/satelliteBridgeDiag.js.map +1 -1
- package/lib/commonjs/satelliteRnDebug.js +160 -0
- package/lib/commonjs/satelliteRnDebug.js.map +1 -0
- package/lib/module/AguaceroContext.js +2 -7
- package/lib/module/AguaceroContext.js.map +1 -1
- package/lib/module/GridRenderLayer.js +66 -80
- package/lib/module/GridRenderLayer.js.map +1 -1
- package/lib/module/MapManager.js +125 -239
- package/lib/module/MapManager.js.map +1 -1
- package/lib/module/MapRegistry.js +21 -33
- package/lib/module/MapRegistry.js.map +1 -1
- package/lib/module/NexradRadarLayer.android.js +32 -104
- package/lib/module/NexradRadarLayer.android.js.map +1 -1
- package/lib/module/NexradRadarLayer.ios.js +30 -101
- package/lib/module/NexradRadarLayer.ios.js.map +1 -1
- package/lib/module/NexradSitesMapLayer.js +44 -63
- package/lib/module/NexradSitesMapLayer.js.map +1 -1
- package/lib/module/SatelliteLayer.android.js +32 -44
- package/lib/module/SatelliteLayer.android.js.map +1 -1
- package/lib/module/SatelliteLayer.ios.js +36 -48
- package/lib/module/SatelliteLayer.ios.js.map +1 -1
- package/lib/module/StyleApplicator.js +144 -191
- package/lib/module/StyleApplicator.js.map +1 -1
- package/lib/module/WeatherLayerManager.js +1024 -1655
- package/lib/module/WeatherLayerManager.js.map +1 -1
- package/lib/module/aguaceroCoreDebugHooks.js +59 -130
- package/lib/module/aguaceroCoreDebugHooks.js.map +1 -1
- package/lib/module/aguaceroRnDebug.js +151 -291
- package/lib/module/aguaceroRnDebug.js.map +1 -1
- package/lib/module/cdnAuthenticatedFetch.js +97 -0
- package/lib/module/cdnAuthenticatedFetch.js.map +1 -0
- package/lib/module/dispatchViewManagerCommandCompat.js +52 -90
- package/lib/module/dispatchViewManagerCommandCompat.js.map +1 -1
- package/lib/module/gridCdnAuth.js +38 -50
- package/lib/module/gridCdnAuth.js.map +1 -1
- package/lib/module/index.js +9 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/nexrad/nexradAndroidController.js +865 -876
- package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
- package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
- package/lib/module/nexrad/nexradDiag.js +31 -145
- package/lib/module/nexrad/nexradDiag.js.map +1 -1
- package/lib/module/nexrad/nexradLevel2Keys.js +245 -0
- package/lib/module/nexrad/nexradLevel2Keys.js.map +1 -0
- package/lib/module/nexrad/nexradLutBuild.js +64 -110
- package/lib/module/nexrad/nexradLutBuild.js.map +1 -1
- package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js +136 -163
- package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
- package/lib/module/nexrad/nexradSdkImports.js +4 -0
- package/lib/module/nexrad/nexradSdkImports.js.map +1 -0
- package/lib/module/nexrad/radarArchiveCore.bundled.js +2839 -4448
- package/lib/module/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/module/nexrad/radarDecode.worker.bundled.js +445 -648
- package/lib/module/nexrad/radarDecode.worker.bundled.js.map +1 -1
- package/lib/module/nexrad/radarFrameGpuMatch.bundled.js +50 -66
- package/lib/module/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
- package/lib/module/nexradNativeCommandIds.js +18 -0
- package/lib/module/nexradNativeCommandIds.js.map +1 -0
- package/lib/module/nws/NwsAlertsOverlay.android.js +1 -1
- package/lib/module/nws/NwsAlertsOverlay.android.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.ios.js +1 -1
- package/lib/module/nws/NwsAlertsOverlay.ios.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.js +5 -5
- package/lib/module/nws/NwsAlertsOverlay.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.native.js +248 -373
- package/lib/module/nws/NwsAlertsOverlay.native.js.map +1 -1
- package/lib/module/nws/eventSourceRnPolyfill.js +92 -146
- package/lib/module/nws/eventSourceRnPolyfill.js.map +1 -1
- package/lib/module/nws/nwsAndroidConstants.js +2 -8
- package/lib/module/nws/nwsAndroidConstants.js.map +1 -1
- package/lib/module/satellite/satelliteAndroidController.js +125 -202
- package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/module/satelliteBridgeDiag.js +3 -13
- package/lib/module/satelliteBridgeDiag.js.map +1 -1
- package/lib/module/satelliteRnDebug.js +148 -0
- package/lib/module/satelliteRnDebug.js.map +1 -0
- package/lib/typescript/AguaceroContext.d.ts +0 -4
- package/lib/typescript/AguaceroContext.d.ts.map +1 -1
- package/lib/typescript/GridRenderLayer.d.ts.map +1 -1
- package/lib/typescript/MapManager.d.ts +0 -12
- package/lib/typescript/MapManager.d.ts.map +1 -1
- package/lib/typescript/MapRegistry.d.ts +10 -12
- package/lib/typescript/MapRegistry.d.ts.map +1 -1
- package/lib/typescript/NexradRadarLayer.android.d.ts.map +1 -1
- package/lib/typescript/NexradRadarLayer.ios.d.ts.map +1 -1
- package/lib/typescript/NexradSitesMapLayer.d.ts +4 -10
- package/lib/typescript/NexradSitesMapLayer.d.ts.map +1 -1
- package/lib/typescript/SatelliteLayer.android.d.ts.map +1 -1
- package/lib/typescript/SatelliteLayer.ios.d.ts.map +1 -1
- package/lib/typescript/StyleApplicator.d.ts +1 -1
- package/lib/typescript/StyleApplicator.d.ts.map +1 -1
- package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts +2 -9
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts.map +1 -1
- package/lib/typescript/aguaceroRnDebug.d.ts +47 -66
- package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
- package/lib/typescript/cdnAuthenticatedFetch.d.ts +10 -0
- package/lib/typescript/cdnAuthenticatedFetch.d.ts.map +1 -0
- package/lib/typescript/dispatchViewManagerCommandCompat.d.ts +1 -17
- package/lib/typescript/dispatchViewManagerCommandCompat.d.ts.map +1 -1
- package/lib/typescript/gridCdnAuth.d.ts +16 -21
- package/lib/typescript/gridCdnAuth.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/nexrad/nexradAndroidController.d.ts +39 -89
- package/lib/typescript/nexrad/nexradAndroidController.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts +2 -1
- package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradDiag.d.ts +13 -101
- package/lib/typescript/nexrad/nexradDiag.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradLevel2Keys.d.ts +36 -0
- package/lib/typescript/nexrad/nexradLevel2Keys.d.ts.map +1 -0
- package/lib/typescript/nexrad/nexradLutBuild.d.ts +3 -10
- package/lib/typescript/nexrad/nexradLutBuild.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts +4 -3
- package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradSdkImports.d.ts +2 -0
- package/lib/typescript/nexrad/nexradSdkImports.d.ts.map +1 -0
- package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts +12 -7
- package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts +20 -20
- package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts +4 -3
- package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts.map +1 -1
- package/lib/typescript/nexradNativeCommandIds.d.ts +2 -0
- package/lib/typescript/nexradNativeCommandIds.d.ts.map +1 -0
- package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts +6 -17
- package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts.map +1 -1
- package/lib/typescript/nws/eventSourceRnPolyfill.d.ts +0 -3
- package/lib/typescript/nws/eventSourceRnPolyfill.d.ts.map +1 -1
- package/lib/typescript/nws/nwsAndroidConstants.d.ts +0 -5
- package/lib/typescript/nws/nwsAndroidConstants.d.ts.map +1 -1
- package/lib/typescript/satellite/satelliteAndroidController.d.ts +9 -47
- package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
- package/lib/typescript/satelliteBridgeDiag.d.ts +1 -5
- package/lib/typescript/satelliteBridgeDiag.d.ts.map +1 -1
- package/lib/typescript/satelliteRnDebug.d.ts +75 -0
- package/lib/typescript/satelliteRnDebug.d.ts.map +1 -0
- package/package.json +75 -74
- package/src/AguaceroContext.js +1 -7
- package/src/GridRenderLayer.js +1 -128
- package/src/MapManager.js +1 -277
- package/src/MapRegistry.js +1 -56
- package/src/NexradRadarLayer.android.js +1 -121
- package/src/NexradRadarLayer.ios.js +1 -115
- package/src/NexradSitesMapLayer.js +1 -75
- package/src/SatelliteLayer.android.js +1 -63
- package/src/SatelliteLayer.ios.js +1 -70
- package/src/StyleApplicator.js +1 -241
- package/src/WeatherLayerManager.js +1 -2025
- package/src/aguaceroCoreDebugHooks.js +1 -142
- package/src/aguaceroRnDebug.js +1 -335
- package/src/cdnAuthenticatedFetch.js +1 -0
- package/src/dispatchViewManagerCommandCompat.js +1 -100
- package/src/gridCdnAuth.js +1 -56
- package/src/index.js +1 -19
- package/src/nexrad/nexradAndroidController.js +1 -1078
- package/src/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +1 -91
- package/src/nexrad/nexradDiag.js +1 -150
- package/src/nexrad/nexradLevel2Keys.js +1 -0
- package/src/nexrad/nexradLutBuild.js +1 -126
- package/src/nexrad/nexradMapboxFrameOpts.bundled.js +1 -245
- package/src/nexrad/nexradSdkImports.js +1 -0
- package/src/nexrad/radarArchiveCore.bundled.js +1 -7085
- package/src/nexrad/radarDecode.worker.bundled.js +1 -813
- package/src/nexrad/radarFrameGpuMatch.bundled.js +1 -79
- package/src/nexradNativeCommandIds.js +1 -0
- package/src/nws/NwsAlertsOverlay.android.js +1 -1
- package/src/nws/NwsAlertsOverlay.ios.js +1 -1
- package/src/nws/NwsAlertsOverlay.js +1 -7
- package/src/nws/NwsAlertsOverlay.native.js +1 -463
- package/src/nws/eventSourceRnPolyfill.js +7 -193
- package/src/nws/nwsAndroidConstants.js +1 -8
- package/src/satellite/satelliteAndroidController.js +1 -245
- package/src/satelliteBridgeDiag.js +1 -15
- package/src/satelliteRnDebug.js +1 -0
- package/lib/commonjs/nexrad/nexradNativeCommandIds.js +0 -51
- package/lib/commonjs/nexrad/nexradNativeCommandIds.js.map +0 -1
- package/lib/module/nexrad/nexradNativeCommandIds.js +0 -44
- package/lib/module/nexrad/nexradNativeCommandIds.js.map +0 -1
- package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts +0 -9
- package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts.map +0 -1
- package/src/nexrad/nexradNativeCommandIds.js +0 -44
- /package/lib/commonjs/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
- /package/lib/module/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
- /package/src/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
package/src/StyleApplicator.js
CHANGED
|
@@ -1,241 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Mapbox from '@rnmapbox/maps';
|
|
3
|
-
|
|
4
|
-
// Re-implement the mapping from your web SDK for clarity and maintenance.
|
|
5
|
-
const STYLE_LAYER_MAP = {
|
|
6
|
-
// Background and water layers
|
|
7
|
-
landColor: { layerId: 'AML_-_land' },
|
|
8
|
-
oceanColor: { layerId: 'AML_-_water' },
|
|
9
|
-
waterDepth: { layerId: 'AML_-_water-depth' },
|
|
10
|
-
nationalPark: { layerId: 'AML_-_national-park' },
|
|
11
|
-
|
|
12
|
-
// Line layers
|
|
13
|
-
roads: { layerId: 'AML_-_roads' },
|
|
14
|
-
airports: { layerId: 'AML_-_airports' },
|
|
15
|
-
countries: { layerId: 'AML_-_countries' },
|
|
16
|
-
states: { layerId: 'AML_-_states' },
|
|
17
|
-
counties: { layerId: 'AML_-_counties' },
|
|
18
|
-
waterways: { layerId: 'AML_-_waterway' },
|
|
19
|
-
|
|
20
|
-
// Symbol (label) layers
|
|
21
|
-
continents: { layerId: 'AML_-_continent-label' },
|
|
22
|
-
countriesLabels: { layerId: 'AML_-_country-label' },
|
|
23
|
-
statesLabels: { layerId: 'AML_-_state-label' },
|
|
24
|
-
citiesMajor: { layerId: 'AML_-_major-city-label' },
|
|
25
|
-
citiesMinor: { layerId: 'AML_-_minor-city-label' },
|
|
26
|
-
airportsLabels: { layerId: 'AML_-_airport-label' },
|
|
27
|
-
poi: { layerId: 'AML_-_poi-label' },
|
|
28
|
-
waterLabels: { layerId: 'AML_-_water-point-label' },
|
|
29
|
-
naturalLabels: { layerId: 'AML_-_natural-point-label' },
|
|
30
|
-
subdivisionLabels: { layerId: 'AML_-_subdivision-label' },
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* A utility to sanitize 8-digit hex colors (#rrggbbaa) to 6-digit hex (#rrggbb)
|
|
35
|
-
* as required by some Mapbox properties.
|
|
36
|
-
*/
|
|
37
|
-
function sanitizeColor(color) {
|
|
38
|
-
if (typeof color === 'string' && color.startsWith('#') && color.length === 9) {
|
|
39
|
-
return color.substring(0, 7);
|
|
40
|
-
}
|
|
41
|
-
return color;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Renders a set of Mapbox layers with styles derived from a theme object.
|
|
46
|
-
* This is the declarative, React Native equivalent of `applyStyleCustomizations`.
|
|
47
|
-
*/
|
|
48
|
-
export const StyleApplicator = ({ styles }) => {
|
|
49
|
-
if (!styles) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const { landOcean, transportation, boundaries, waterFeatures, labels, terrain } = styles;
|
|
54
|
-
|
|
55
|
-
// --- Helper for Line Layer Styles ---
|
|
56
|
-
const getLineStyles = (config) => {
|
|
57
|
-
if (!config) return {};
|
|
58
|
-
const dashArray = { dashed: [2, 2], dotted: [0, 2], solid: [] };
|
|
59
|
-
return {
|
|
60
|
-
visibility: config.visible ? 'visible' : 'none',
|
|
61
|
-
lineColor: sanitizeColor(config.color),
|
|
62
|
-
lineWidth: config.width,
|
|
63
|
-
lineDasharray: dashArray[config.lineType] || [],
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// --- Helper for Symbol (Label) Layer Styles ---
|
|
68
|
-
const getSymbolStyles = (config) => {
|
|
69
|
-
if (!config) return {};
|
|
70
|
-
return {
|
|
71
|
-
visibility: config.visible ? 'visible' : 'none',
|
|
72
|
-
textColor: sanitizeColor(config.color),
|
|
73
|
-
textHaloColor: sanitizeColor(config.outlineColor),
|
|
74
|
-
textHaloWidth: config.outlineWidth,
|
|
75
|
-
textSize: config.fontSize,
|
|
76
|
-
textFont: [config.fontFamily],
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<>
|
|
82
|
-
{/* --- Land & Water --- */}
|
|
83
|
-
{landOcean && (
|
|
84
|
-
<>
|
|
85
|
-
<Mapbox.BackgroundLayer
|
|
86
|
-
id={STYLE_LAYER_MAP.landColor.layerId}
|
|
87
|
-
existing={true} // FIX: Added existing prop
|
|
88
|
-
style={{ backgroundColor: sanitizeColor(landOcean.landColor) }}
|
|
89
|
-
/>
|
|
90
|
-
<Mapbox.FillLayer
|
|
91
|
-
id={STYLE_LAYER_MAP.oceanColor.layerId}
|
|
92
|
-
existing={true} // FIX: Added existing prop
|
|
93
|
-
style={{ fillColor: sanitizeColor(landOcean.oceanColor) }}
|
|
94
|
-
/>
|
|
95
|
-
{landOcean.waterDepth && (
|
|
96
|
-
<Mapbox.FillLayer
|
|
97
|
-
id={STYLE_LAYER_MAP.waterDepth.layerId}
|
|
98
|
-
existing={true} // FIX: Added existing prop
|
|
99
|
-
style={{
|
|
100
|
-
visibility: landOcean.waterDepth.visible ? 'visible' : 'none',
|
|
101
|
-
fillColor: sanitizeColor(landOcean.waterDepth.color)
|
|
102
|
-
}}
|
|
103
|
-
/>
|
|
104
|
-
)}
|
|
105
|
-
{landOcean.nationalPark && (
|
|
106
|
-
<Mapbox.FillLayer
|
|
107
|
-
id={STYLE_LAYER_MAP.nationalPark.layerId}
|
|
108
|
-
existing={true} // FIX: Added existing prop
|
|
109
|
-
style={{
|
|
110
|
-
visibility: landOcean.nationalPark.visible ? 'visible' : 'none',
|
|
111
|
-
fillColor: sanitizeColor(landOcean.nationalPark.color)
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
)}
|
|
115
|
-
</>
|
|
116
|
-
)}
|
|
117
|
-
|
|
118
|
-
{/* --- Boundaries & Transportation --- */}
|
|
119
|
-
{boundaries && (
|
|
120
|
-
<>
|
|
121
|
-
<Mapbox.LineLayer
|
|
122
|
-
id={STYLE_LAYER_MAP.countries.layerId}
|
|
123
|
-
existing={true} // FIX: Added existing prop
|
|
124
|
-
style={getLineStyles(boundaries.countries)}
|
|
125
|
-
/>
|
|
126
|
-
<Mapbox.LineLayer
|
|
127
|
-
id={STYLE_LAYER_MAP.states.layerId}
|
|
128
|
-
existing={true} // FIX: Added existing prop
|
|
129
|
-
style={getLineStyles(boundaries.states)}
|
|
130
|
-
/>
|
|
131
|
-
<Mapbox.LineLayer
|
|
132
|
-
id={STYLE_LAYER_MAP.counties.layerId}
|
|
133
|
-
existing={true} // FIX: Added existing prop
|
|
134
|
-
style={getLineStyles(boundaries.counties)}
|
|
135
|
-
/>
|
|
136
|
-
</>
|
|
137
|
-
)}
|
|
138
|
-
{transportation && (
|
|
139
|
-
<>
|
|
140
|
-
<Mapbox.LineLayer
|
|
141
|
-
id={STYLE_LAYER_MAP.roads.layerId}
|
|
142
|
-
existing={true} // FIX: Added existing prop
|
|
143
|
-
style={getLineStyles(transportation.roads)}
|
|
144
|
-
/>
|
|
145
|
-
<Mapbox.LineLayer
|
|
146
|
-
id={STYLE_LAYER_MAP.airports.layerId}
|
|
147
|
-
existing={true} // FIX: Added existing prop
|
|
148
|
-
style={getLineStyles(transportation.airports)}
|
|
149
|
-
/>
|
|
150
|
-
</>
|
|
151
|
-
)}
|
|
152
|
-
{waterFeatures && (
|
|
153
|
-
<Mapbox.LineLayer
|
|
154
|
-
id={STYLE_LAYER_MAP.waterways.layerId}
|
|
155
|
-
existing={true} // FIX: Added existing prop
|
|
156
|
-
style={getLineStyles(waterFeatures.waterways)}
|
|
157
|
-
/>
|
|
158
|
-
)}
|
|
159
|
-
|
|
160
|
-
{/* --- Labels --- */}
|
|
161
|
-
{labels && (
|
|
162
|
-
<>
|
|
163
|
-
<Mapbox.SymbolLayer
|
|
164
|
-
id={STYLE_LAYER_MAP.continents.layerId}
|
|
165
|
-
existing={true} // FIX: Added existing prop
|
|
166
|
-
style={getSymbolStyles(labels.continents)}
|
|
167
|
-
/>
|
|
168
|
-
<Mapbox.SymbolLayer
|
|
169
|
-
id={STYLE_LAYER_MAP.countriesLabels.layerId}
|
|
170
|
-
existing={true} // FIX: Added existing prop
|
|
171
|
-
style={getSymbolStyles(labels.countries)}
|
|
172
|
-
/>
|
|
173
|
-
<Mapbox.SymbolLayer
|
|
174
|
-
id={STYLE_LAYER_MAP.statesLabels.layerId}
|
|
175
|
-
existing={true} // FIX: Added existing prop
|
|
176
|
-
style={getSymbolStyles(labels.states)}
|
|
177
|
-
/>
|
|
178
|
-
{labels.cities && (
|
|
179
|
-
<>
|
|
180
|
-
<Mapbox.SymbolLayer
|
|
181
|
-
id={STYLE_LAYER_MAP.citiesMajor.layerId}
|
|
182
|
-
existing={true} // FIX: Added existing prop
|
|
183
|
-
style={getSymbolStyles(labels.cities.major)}
|
|
184
|
-
/>
|
|
185
|
-
<Mapbox.SymbolLayer
|
|
186
|
-
id={STYLE_LAYER_MAP.citiesMinor.layerId}
|
|
187
|
-
existing={true} // FIX: Added existing prop
|
|
188
|
-
style={getSymbolStyles(labels.cities.minor)}
|
|
189
|
-
/>
|
|
190
|
-
</>
|
|
191
|
-
)}
|
|
192
|
-
<Mapbox.SymbolLayer
|
|
193
|
-
id={STYLE_LAYER_MAP.airportsLabels.layerId}
|
|
194
|
-
existing={true} // FIX: Added existing prop
|
|
195
|
-
style={getSymbolStyles(labels.airports)}
|
|
196
|
-
/>
|
|
197
|
-
<Mapbox.SymbolLayer
|
|
198
|
-
id={STYLE_LAYER_MAP.poi.layerId}
|
|
199
|
-
existing={true} // FIX: Added existing prop
|
|
200
|
-
style={getSymbolStyles(labels.poi)}
|
|
201
|
-
/>
|
|
202
|
-
<Mapbox.SymbolLayer
|
|
203
|
-
id={STYLE_LAYER_MAP.waterLabels.layerId}
|
|
204
|
-
existing={true} // FIX: Added existing prop
|
|
205
|
-
style={getSymbolStyles(labels.waterLabels)}
|
|
206
|
-
/>
|
|
207
|
-
<Mapbox.SymbolLayer
|
|
208
|
-
id={STYLE_LAYER_MAP.naturalLabels.layerId}
|
|
209
|
-
existing={true} // FIX: Added existing prop
|
|
210
|
-
style={getSymbolStyles(labels.naturalLabels)}
|
|
211
|
-
/>
|
|
212
|
-
<Mapbox.SymbolLayer
|
|
213
|
-
id={STYLE_LAYER_MAP.subdivisionLabels.layerId}
|
|
214
|
-
existing={true} // FIX: Added existing prop
|
|
215
|
-
style={getSymbolStyles(labels.subdivisionLabels)}
|
|
216
|
-
/>
|
|
217
|
-
</>
|
|
218
|
-
)}
|
|
219
|
-
|
|
220
|
-
{/* --- Terrain --- */}
|
|
221
|
-
{terrain && terrain.visible && Mapbox.Terrain && Mapbox.HillshadeLayer && (
|
|
222
|
-
<>
|
|
223
|
-
<Mapbox.Terrain
|
|
224
|
-
sourceID="mapbox-dem"
|
|
225
|
-
style={{ exaggeration: 1 }}
|
|
226
|
-
/>
|
|
227
|
-
<Mapbox.HillshadeLayer
|
|
228
|
-
id="hillshade"
|
|
229
|
-
sourceID="mapbox-dem"
|
|
230
|
-
style={{
|
|
231
|
-
hillshadeExaggeration: terrain.intensity,
|
|
232
|
-
hillshadeShadowColor: sanitizeColor(terrain.shadowColor),
|
|
233
|
-
hillshadeHighlightColor: sanitizeColor(terrain.highlightColor),
|
|
234
|
-
hillshadeAccentColor: sanitizeColor(terrain.accentColor)
|
|
235
|
-
}}
|
|
236
|
-
/>
|
|
237
|
-
</>
|
|
238
|
-
)}
|
|
239
|
-
</>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
1
|
+
import e from"react";import t from"@rnmapbox/maps";const a={landColor:{layerId:"AML_-_land"},oceanColor:{layerId:"AML_-_water"},waterDepth:{layerId:"AML_-_water-depth"},nationalPark:{layerId:"AML_-_national-park"},roads:{layerId:"AML_-_roads"},airports:{layerId:"AML_-_airports"},countries:{layerId:"AML_-_countries"},states:{layerId:"AML_-_states"},counties:{layerId:"AML_-_counties"},waterways:{layerId:"AML_-_waterway"},continents:{layerId:"AML_-_continent-label"},countriesLabels:{layerId:"AML_-_country-label"},statesLabels:{layerId:"AML_-_state-label"},citiesMajor:{layerId:"AML_-_major-city-label"},citiesMinor:{layerId:"AML_-_minor-city-label"},airportsLabels:{layerId:"AML_-_airport-label"},poi:{layerId:"AML_-_poi-label"},waterLabels:{layerId:"AML_-_water-point-label"},naturalLabels:{layerId:"AML_-_natural-point-label"},subdivisionLabels:{layerId:"AML_-_subdivision-label"}};function n(o){return typeof o=="string"&&o.startsWith("#")&&o.length===9?o.substring(0,7):o}export const StyleApplicator=({styles:o})=>{if(!o)return null;const{landOcean:s,transportation:L,boundaries:c,waterFeatures:b,labels:r,terrain:y}=o,d=l=>{if(!l)return{};const m={dashed:[2,2],dotted:[0,2],solid:[]};return{visibility:l.visible?"visible":"none",lineColor:n(l.color),lineWidth:l.width,lineDasharray:m[l.lineType]||[]}},i=l=>l?{visibility:l.visible?"visible":"none",textColor:n(l.color),textHaloColor:n(l.outlineColor),textHaloWidth:l.outlineWidth,textSize:l.fontSize,textFont:[l.fontFamily]}:{};return e.createElement(e.Fragment,null,s&&e.createElement(e.Fragment,null,e.createElement(t.BackgroundLayer,{id:a.landColor.layerId,existing:!0,style:{backgroundColor:n(s.landColor)}}),e.createElement(t.FillLayer,{id:a.oceanColor.layerId,existing:!0,style:{fillColor:n(s.oceanColor)}}),s.waterDepth&&e.createElement(t.FillLayer,{id:a.waterDepth.layerId,existing:!0,style:{visibility:s.waterDepth.visible?"visible":"none",fillColor:n(s.waterDepth.color)}}),s.nationalPark&&e.createElement(t.FillLayer,{id:a.nationalPark.layerId,existing:!0,style:{visibility:s.nationalPark.visible?"visible":"none",fillColor:n(s.nationalPark.color)}})),c&&e.createElement(e.Fragment,null,e.createElement(t.LineLayer,{id:a.countries.layerId,existing:!0,style:d(c.countries)}),e.createElement(t.LineLayer,{id:a.states.layerId,existing:!0,style:d(c.states)}),e.createElement(t.LineLayer,{id:a.counties.layerId,existing:!0,style:d(c.counties)})),L&&e.createElement(e.Fragment,null,e.createElement(t.LineLayer,{id:a.roads.layerId,existing:!0,style:d(L.roads)}),e.createElement(t.LineLayer,{id:a.airports.layerId,existing:!0,style:d(L.airports)})),b&&e.createElement(t.LineLayer,{id:a.waterways.layerId,existing:!0,style:d(b.waterways)}),r&&e.createElement(e.Fragment,null,e.createElement(t.SymbolLayer,{id:a.continents.layerId,existing:!0,style:i(r.continents)}),e.createElement(t.SymbolLayer,{id:a.countriesLabels.layerId,existing:!0,style:i(r.countries)}),e.createElement(t.SymbolLayer,{id:a.statesLabels.layerId,existing:!0,style:i(r.states)}),r.cities&&e.createElement(e.Fragment,null,e.createElement(t.SymbolLayer,{id:a.citiesMajor.layerId,existing:!0,style:i(r.cities.major)}),e.createElement(t.SymbolLayer,{id:a.citiesMinor.layerId,existing:!0,style:i(r.cities.minor)})),e.createElement(t.SymbolLayer,{id:a.airportsLabels.layerId,existing:!0,style:i(r.airports)}),e.createElement(t.SymbolLayer,{id:a.poi.layerId,existing:!0,style:i(r.poi)}),e.createElement(t.SymbolLayer,{id:a.waterLabels.layerId,existing:!0,style:i(r.waterLabels)}),e.createElement(t.SymbolLayer,{id:a.naturalLabels.layerId,existing:!0,style:i(r.naturalLabels)}),e.createElement(t.SymbolLayer,{id:a.subdivisionLabels.layerId,existing:!0,style:i(r.subdivisionLabels)})),y&&y.visible&&t.Terrain&&t.HillshadeLayer&&e.createElement(e.Fragment,null,e.createElement(t.Terrain,{sourceID:"mapbox-dem",style:{exaggeration:1}}),e.createElement(t.HillshadeLayer,{id:"hillshade",sourceID:"mapbox-dem",style:{hillshadeExaggeration:y.intensity,hillshadeShadowColor:n(y.shadowColor),hillshadeHighlightColor:n(y.highlightColor),hillshadeAccentColor:n(y.accentColor)}})))};
|