@maplibre/maplibre-react-native 10.0.0-beta.1 → 10.0.0-beta.10
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/README.md +34 -35
- package/android/build.gradle +98 -51
- package/android/gradle.properties +7 -0
- package/android/src/main/AndroidManifest.xml +4 -2
- package/android/src/main/AndroidManifestNew.xml +5 -0
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.java +0 -5
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +0 -145
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +80 -0
- package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
- package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.m +1 -0
- package/ios/MLRN/MLRNLineLayer.h +0 -1
- package/ios/MLRN/MLRNModule.m +0 -135
- package/ios/MLRN/MLRNRasterLayer.h +0 -1
- package/ios/MLRN/MLRNShapeSource.h +0 -11
- package/ios/MLRN/MLRNShapeSource.m +0 -38
- package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
- package/ios/MLRN/MLRNSymbolLayer.h +1 -7
- package/ios/MLRN/MLRNSymbolLayer.m +1 -89
- package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
- package/lib/commonjs/MLRNModule.js +7 -5
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/MapLibreRN.js +3 -15
- package/lib/commonjs/MapLibreRN.js.map +1 -1
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/Images.js +1 -5
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/MapView.js +0 -7
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +6 -38
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +2 -17
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +1 -11
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
- package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
- package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
- package/lib/commonjs/utils/StyleValue.js +2 -2
- package/lib/commonjs/utils/StyleValue.js.map +1 -1
- package/lib/commonjs/utils/getStylePropertyType.js +252 -0
- package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
- package/lib/module/MLRNModule.js +3 -2
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/MapLibreRN.js +1 -5
- package/lib/module/MapLibreRN.js.map +1 -1
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/Images.js +1 -5
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/MapView.js +0 -7
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/ShapeSource.js +5 -37
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +3 -18
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/VectorSource.js +1 -11
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/modules/offline/offlineManager.js +1 -1
- package/lib/module/modules/offline/offlineManager.js.map +1 -1
- package/lib/module/types/MapLibreRNStyles.js +4 -0
- package/lib/module/types/MapLibreRNStyles.js.map +1 -0
- package/lib/module/utils/StyleValue.js +2 -2
- package/lib/module/utils/StyleValue.js.map +1 -1
- package/lib/module/utils/getStylePropertyType.js +248 -0
- package/lib/module/utils/getStylePropertyType.js.map +1 -0
- package/lib/typescript/commonjs/jest.config.d.ts +2 -0
- package/lib/typescript/commonjs/jest.config.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +5 -8
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Camera.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +2 -8
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +4 -14
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/lib/typescript/module/jest.config.d.ts +2 -0
- package/lib/typescript/module/jest.config.d.ts.map +1 -0
- package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +5 -8
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Camera.d.ts +1 -1
- package/lib/typescript/module/src/components/CircleLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Light.d.ts +2 -2
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/module/src/components/LineLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MapView.d.ts +1 -2
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -2
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +2 -8
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +2 -2
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +1 -1
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +4 -14
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/package.json +31 -38
- package/plugin/build/withMapLibre.js +6 -6
- package/src/MLRNModule.ts +15 -9
- package/src/MapLibreRN.ts +22 -23
- package/src/components/Annotation.tsx +3 -3
- package/src/components/BackgroundLayer.tsx +2 -2
- package/src/components/Camera.tsx +1 -1
- package/src/components/CircleLayer.tsx +2 -2
- package/src/components/FillExtrusionLayer.tsx +2 -2
- package/src/components/FillLayer.tsx +2 -2
- package/src/components/HeatmapLayer.tsx +2 -2
- package/src/components/Images.tsx +1 -10
- package/src/components/Light.tsx +2 -2
- package/src/components/LineLayer.tsx +2 -2
- package/src/components/MapView.tsx +1 -12
- package/src/components/RasterLayer.tsx +2 -2
- package/src/components/ShapeSource.tsx +9 -77
- package/src/components/SymbolLayer.tsx +7 -35
- package/src/components/UserLocation.tsx +2 -2
- package/src/components/VectorSource.tsx +5 -21
- package/src/hooks/useAbstractLayer.ts +3 -3
- package/src/modules/offline/OfflinePack.ts +1 -1
- package/src/modules/offline/offlineManager.ts +4 -18
- package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +85 -405
- package/src/utils/StyleValue.ts +4 -4
- package/src/utils/filterUtils.ts +1 -1
- package/src/utils/getStylePropertyType.ts +265 -0
- package/android/install.md +0 -32
- package/android/src/main/res/values/strings.xml +0 -3
- package/ios/install.md +0 -49
- package/lib/commonjs/components/Style.js +0 -266
- package/lib/commonjs/components/Style.js.map +0 -1
- package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
- package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/commonjs/utils/deprecation.js +0 -31
- package/lib/commonjs/utils/deprecation.js.map +0 -1
- package/lib/commonjs/utils/styleMap.js +0 -255
- package/lib/commonjs/utils/styleMap.js.map +0 -1
- package/lib/module/components/Style.js +0 -261
- package/lib/module/components/Style.js.map +0 -1
- package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
- package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/module/utils/deprecation.js +0 -27
- package/lib/module/utils/deprecation.js.map +0 -1
- package/lib/module/utils/styleMap.js +0 -249
- package/lib/module/utils/styleMap.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
- package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Style.d.ts +0 -81
- package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
- package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
- package/src/components/Style.tsx +0 -371
- package/src/utils/deprecation.ts +0 -31
- package/src/utils/styleMap.ts +0 -265
|
@@ -11,9 +11,7 @@ import com.facebook.react.common.MapBuilder;
|
|
|
11
11
|
import com.facebook.react.module.annotations.ReactModule;
|
|
12
12
|
import org.maplibre.android.MapLibre;
|
|
13
13
|
import org.maplibre.android.WellKnownTileServer;
|
|
14
|
-
import org.maplibre.android.style.layers.Property;
|
|
15
14
|
import org.maplibre.reactnative.components.camera.constants.CameraMode;
|
|
16
|
-
import org.maplibre.reactnative.components.styles.MLRNStyleValue;
|
|
17
15
|
import org.maplibre.reactnative.components.styles.sources.MLRNSource;
|
|
18
16
|
import org.maplibre.reactnative.events.constants.EventTypes;
|
|
19
17
|
import org.maplibre.reactnative.http.CustomHeadersInterceptor;
|
|
@@ -99,127 +97,6 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
99
97
|
Map<String, String> styleSourceConsts = new HashMap<>();
|
|
100
98
|
styleSourceConsts.put("DefaultSourceID", MLRNSource.DEFAULT_ID);
|
|
101
99
|
|
|
102
|
-
// interpolation modes
|
|
103
|
-
Map<String, Integer> interpolationModes = new HashMap<>();
|
|
104
|
-
interpolationModes.put("Exponential", MLRNStyleValue.InterpolationModeExponential);
|
|
105
|
-
interpolationModes.put("Categorical", MLRNStyleValue.InterpolationModeCategorical);
|
|
106
|
-
interpolationModes.put("Interval", MLRNStyleValue.InterpolationModeInterval);
|
|
107
|
-
interpolationModes.put("Identity", MLRNStyleValue.InterpolationModeIdentity);
|
|
108
|
-
|
|
109
|
-
// line layer constants
|
|
110
|
-
Map<String, String> lineJoin = new HashMap<>();
|
|
111
|
-
lineJoin.put("Bevel", Property.LINE_JOIN_BEVEL);
|
|
112
|
-
lineJoin.put("Round", Property.LINE_JOIN_ROUND);
|
|
113
|
-
lineJoin.put("Miter", Property.LINE_JOIN_MITER);
|
|
114
|
-
|
|
115
|
-
Map<String, String> lineCap = new HashMap<>();
|
|
116
|
-
lineCap.put("Butt", Property.LINE_CAP_BUTT);
|
|
117
|
-
lineCap.put("Round", Property.LINE_CAP_ROUND);
|
|
118
|
-
lineCap.put("Square", Property.LINE_CAP_SQUARE);
|
|
119
|
-
|
|
120
|
-
Map<String, String> lineTranslateAnchor = new HashMap<>();
|
|
121
|
-
lineTranslateAnchor.put("Map", Property.LINE_TRANSLATE_ANCHOR_MAP);
|
|
122
|
-
lineTranslateAnchor.put("Viewport", Property.LINE_TRANSLATE_ANCHOR_VIEWPORT);
|
|
123
|
-
|
|
124
|
-
// circle layer constants
|
|
125
|
-
Map<String, String> circlePitchScale = new HashMap<>();
|
|
126
|
-
circlePitchScale.put("Map", Property.CIRCLE_PITCH_SCALE_MAP);
|
|
127
|
-
circlePitchScale.put("Viewport", Property.CIRCLE_PITCH_SCALE_VIEWPORT);
|
|
128
|
-
|
|
129
|
-
Map<String, String> circleTranslateAnchor = new HashMap<>();
|
|
130
|
-
circleTranslateAnchor.put("Map", Property.CIRCLE_TRANSLATE_ANCHOR_MAP);
|
|
131
|
-
circleTranslateAnchor.put("Viewport", Property.CIRCLE_TRANSLATE_ANCHOR_VIEWPORT);
|
|
132
|
-
|
|
133
|
-
Map<String, String> circlePitchAlignment = new HashMap<>();
|
|
134
|
-
circlePitchAlignment.put("Map", Property.CIRCLE_PITCH_ALIGNMENT_MAP);
|
|
135
|
-
circlePitchAlignment.put("Viewport", Property.CIRCLE_PITCH_ALIGNMENT_VIEWPORT);
|
|
136
|
-
|
|
137
|
-
// fill extrusion layer constants
|
|
138
|
-
Map<String, String> fillExtrusionTranslateAnchor = new HashMap<>();
|
|
139
|
-
fillExtrusionTranslateAnchor.put("Map", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_MAP);
|
|
140
|
-
fillExtrusionTranslateAnchor.put("Viewport", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_VIEWPORT);
|
|
141
|
-
|
|
142
|
-
// fill layer constants
|
|
143
|
-
Map<String, String> fillTranslateAnchor = new HashMap<>();
|
|
144
|
-
fillTranslateAnchor.put("Map", Property.FILL_TRANSLATE_ANCHOR_MAP);
|
|
145
|
-
fillTranslateAnchor.put("Viewport", Property.FILL_TRANSLATE_ANCHOR_VIEWPORT);
|
|
146
|
-
|
|
147
|
-
// symbol layer constants
|
|
148
|
-
Map<String, String> iconRotationAlignment = new HashMap<>();
|
|
149
|
-
iconRotationAlignment.put("Auto", Property.ICON_ROTATION_ALIGNMENT_AUTO);
|
|
150
|
-
iconRotationAlignment.put("Map", Property.ICON_ROTATION_ALIGNMENT_MAP);
|
|
151
|
-
iconRotationAlignment.put("Viewport", Property.ICON_ROTATION_ALIGNMENT_VIEWPORT);
|
|
152
|
-
|
|
153
|
-
Map<String, String> iconTextFit = new HashMap<>();
|
|
154
|
-
iconTextFit.put("None", Property.ICON_TEXT_FIT_NONE);
|
|
155
|
-
iconTextFit.put("Width", Property.ICON_TEXT_FIT_WIDTH);
|
|
156
|
-
iconTextFit.put("Height", Property.ICON_TEXT_FIT_HEIGHT);
|
|
157
|
-
iconTextFit.put("Both", Property.ICON_TEXT_FIT_BOTH);
|
|
158
|
-
|
|
159
|
-
Map<String, String> iconAnchor = new HashMap<>();
|
|
160
|
-
iconAnchor.put("Center", Property.ICON_ANCHOR_CENTER);
|
|
161
|
-
iconAnchor.put("Left", Property.ICON_ANCHOR_LEFT);
|
|
162
|
-
iconAnchor.put("Right", Property.ICON_ANCHOR_RIGHT);
|
|
163
|
-
iconAnchor.put("Top", Property.ICON_ANCHOR_TOP);
|
|
164
|
-
iconAnchor.put("Bottom", Property.ICON_ANCHOR_BOTTOM);
|
|
165
|
-
iconAnchor.put("TopLeft", Property.ICON_ANCHOR_TOP_LEFT);
|
|
166
|
-
iconAnchor.put("TopRight", Property.ICON_ANCHOR_TOP_RIGHT);
|
|
167
|
-
iconAnchor.put("BottomLeft", Property.ICON_ANCHOR_BOTTOM_LEFT);
|
|
168
|
-
iconAnchor.put("BottomRight", Property.ICON_ANCHOR_BOTTOM_RIGHT);
|
|
169
|
-
|
|
170
|
-
Map<String, String> iconPitchAlignment = new HashMap<>();
|
|
171
|
-
iconPitchAlignment.put("Auto", Property.ICON_PITCH_ALIGNMENT_AUTO);
|
|
172
|
-
iconPitchAlignment.put("Map", Property.ICON_PITCH_ALIGNMENT_MAP);
|
|
173
|
-
iconPitchAlignment.put("Viewport", Property.ICON_PITCH_ALIGNMENT_VIEWPORT);
|
|
174
|
-
|
|
175
|
-
Map<String, String> iconTranslateAnchor = new HashMap<>();
|
|
176
|
-
iconTranslateAnchor.put("Map", Property.ICON_TRANSLATE_ANCHOR_MAP);
|
|
177
|
-
iconTranslateAnchor.put("Viewport", Property.ICON_TRANSLATE_ANCHOR_VIEWPORT);
|
|
178
|
-
|
|
179
|
-
Map<String, String> symbolPlacement = new HashMap<>();
|
|
180
|
-
symbolPlacement.put("Line", Property.SYMBOL_PLACEMENT_LINE);
|
|
181
|
-
symbolPlacement.put("Point", Property.SYMBOL_PLACEMENT_POINT);
|
|
182
|
-
|
|
183
|
-
Map<String, String> textAnchor = new HashMap<>();
|
|
184
|
-
textAnchor.put("Center", Property.TEXT_ANCHOR_CENTER);
|
|
185
|
-
textAnchor.put("Left", Property.TEXT_ANCHOR_LEFT);
|
|
186
|
-
textAnchor.put("Right", Property.TEXT_ANCHOR_RIGHT);
|
|
187
|
-
textAnchor.put("Top", Property.TEXT_ANCHOR_TOP);
|
|
188
|
-
textAnchor.put("Bottom", Property.TEXT_ANCHOR_BOTTOM);
|
|
189
|
-
textAnchor.put("TopLeft", Property.TEXT_ANCHOR_TOP_LEFT);
|
|
190
|
-
textAnchor.put("TopRight", Property.TEXT_ANCHOR_TOP_RIGHT);
|
|
191
|
-
textAnchor.put("BottomLeft", Property.TEXT_ANCHOR_BOTTOM_LEFT);
|
|
192
|
-
textAnchor.put("BottomRight", Property.TEXT_ANCHOR_BOTTOM_RIGHT);
|
|
193
|
-
|
|
194
|
-
Map<String, String> textJustify = new HashMap<>();
|
|
195
|
-
textJustify.put("Center", Property.TEXT_JUSTIFY_CENTER);
|
|
196
|
-
textJustify.put("Left", Property.TEXT_JUSTIFY_LEFT);
|
|
197
|
-
textJustify.put("Right", Property.TEXT_JUSTIFY_RIGHT);
|
|
198
|
-
|
|
199
|
-
Map<String, String> textPitchAlignment = new HashMap<>();
|
|
200
|
-
textPitchAlignment.put("Auto", Property.TEXT_PITCH_ALIGNMENT_AUTO);
|
|
201
|
-
textPitchAlignment.put("Map", Property.TEXT_PITCH_ALIGNMENT_MAP);
|
|
202
|
-
textPitchAlignment.put("Viewport", Property.TEXT_PITCH_ALIGNMENT_VIEWPORT);
|
|
203
|
-
|
|
204
|
-
Map<String, String> textRotationAlignment = new HashMap<>();
|
|
205
|
-
textRotationAlignment.put("Auto", Property.TEXT_ROTATION_ALIGNMENT_AUTO);
|
|
206
|
-
textRotationAlignment.put("Map", Property.TEXT_ROTATION_ALIGNMENT_MAP);
|
|
207
|
-
textRotationAlignment.put("Viewport", Property.TEXT_ROTATION_ALIGNMENT_VIEWPORT);
|
|
208
|
-
|
|
209
|
-
Map<String, String> textTransform = new HashMap<>();
|
|
210
|
-
textTransform.put("None", Property.TEXT_TRANSFORM_NONE);
|
|
211
|
-
textTransform.put("Lowercase", Property.TEXT_TRANSFORM_LOWERCASE);
|
|
212
|
-
textTransform.put("Uppercase", Property.TEXT_TRANSFORM_UPPERCASE);
|
|
213
|
-
|
|
214
|
-
Map<String, String> textTranslateAnchor = new HashMap<>();
|
|
215
|
-
textTranslateAnchor.put("Map", Property.TEXT_TRANSLATE_ANCHOR_MAP);
|
|
216
|
-
textTranslateAnchor.put("Viewport", Property.TEXT_TRANSLATE_ANCHOR_VIEWPORT);
|
|
217
|
-
|
|
218
|
-
// light constants
|
|
219
|
-
Map<String, String> lightAnchor = new HashMap<>();
|
|
220
|
-
lightAnchor.put("Map", Property.ANCHOR_MAP);
|
|
221
|
-
lightAnchor.put("Viewport", Property.ANCHOR_VIEWPORT);
|
|
222
|
-
|
|
223
100
|
// offline region download states
|
|
224
101
|
Map<String, Integer> offlinePackDownloadStates = new HashMap<>();
|
|
225
102
|
offlinePackDownloadStates.put("Inactive", MLRNOfflineModule.INACTIVE_REGION_DOWNLOAD_STATE);
|
|
@@ -242,28 +119,6 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
242
119
|
.put("UserLocationVerticalAlignment", userLocationVerticalAlignment)
|
|
243
120
|
.put("CameraModes", cameraModes)
|
|
244
121
|
.put("StyleSource", styleSourceConsts)
|
|
245
|
-
.put("InterpolationMode", interpolationModes)
|
|
246
|
-
.put("LineJoin", lineJoin)
|
|
247
|
-
.put("LineCap", lineCap)
|
|
248
|
-
.put("LineTranslateAnchor", lineTranslateAnchor)
|
|
249
|
-
.put("CirclePitchScale", circlePitchScale)
|
|
250
|
-
.put("CircleTranslateAnchor", circleTranslateAnchor)
|
|
251
|
-
.put("CirclePitchAlignment", circlePitchAlignment)
|
|
252
|
-
.put("FillExtrusionTranslateAnchor", fillExtrusionTranslateAnchor)
|
|
253
|
-
.put("FillTranslateAnchor", fillTranslateAnchor)
|
|
254
|
-
.put("IconRotationAlignment", iconRotationAlignment)
|
|
255
|
-
.put("IconTextFit", iconTextFit)
|
|
256
|
-
.put("IconTranslateAnchor", iconTranslateAnchor)
|
|
257
|
-
.put("SymbolPlacement", symbolPlacement)
|
|
258
|
-
.put("IconAnchor", iconAnchor)
|
|
259
|
-
.put("TextAnchor", textAnchor)
|
|
260
|
-
.put("TextJustify", textJustify)
|
|
261
|
-
.put("IconPitchAlignment", iconPitchAlignment)
|
|
262
|
-
.put("TextPitchAlignment", textPitchAlignment)
|
|
263
|
-
.put("TextRotationAlignment", textRotationAlignment)
|
|
264
|
-
.put("TextTransform", textTransform)
|
|
265
|
-
.put("TextTranslateAnchor", textTranslateAnchor)
|
|
266
|
-
.put("LightAnchor", lightAnchor)
|
|
267
122
|
.put("OfflinePackDownloadState", offlinePackDownloadStates)
|
|
268
123
|
.put("OfflineCallbackName", offlineModuleCallbackNames)
|
|
269
124
|
.put("LocationCallbackName", locationModuleCallbackNames)
|
|
@@ -10,9 +10,11 @@ import org.maplibre.geojson.Feature;
|
|
|
10
10
|
import org.maplibre.geojson.FeatureCollection;
|
|
11
11
|
import org.maplibre.geojson.Geometry;
|
|
12
12
|
import org.maplibre.geojson.GeometryCollection;
|
|
13
|
+
import org.maplibre.geojson.MultiLineString;
|
|
13
14
|
import org.maplibre.geojson.LineString;
|
|
14
15
|
import org.maplibre.geojson.MultiPoint;
|
|
15
16
|
import org.maplibre.geojson.Point;
|
|
17
|
+
import org.maplibre.geojson.MultiPolygon;
|
|
16
18
|
import org.maplibre.geojson.Polygon;
|
|
17
19
|
import org.maplibre.android.geometry.LatLng;
|
|
18
20
|
import org.maplibre.android.geometry.LatLngBounds;
|
|
@@ -48,6 +50,12 @@ public class GeoJSONUtils {
|
|
|
48
50
|
return fromLineString((LineString) geometry);
|
|
49
51
|
case "Polygon":
|
|
50
52
|
return fromPolygon((Polygon) geometry);
|
|
53
|
+
case "MultiPoint":
|
|
54
|
+
return fromMultiPoint((MultiPoint) geometry);
|
|
55
|
+
case "MultiLineString":
|
|
56
|
+
return fromMultiLineString((MultiLineString) geometry);
|
|
57
|
+
case "MultiPolygon":
|
|
58
|
+
return fromMultiPolygon((MultiPolygon) geometry);
|
|
51
59
|
default:
|
|
52
60
|
return null;
|
|
53
61
|
}
|
|
@@ -74,6 +82,27 @@ public class GeoJSONUtils {
|
|
|
74
82
|
return map;
|
|
75
83
|
}
|
|
76
84
|
|
|
85
|
+
public static WritableMap fromMultiPoint(MultiPoint multiPoint) {
|
|
86
|
+
WritableMap map = Arguments.createMap();
|
|
87
|
+
map.putString("type", "MultiPoint");
|
|
88
|
+
map.putArray("coordinates", getCoordinates(multiPoint));
|
|
89
|
+
return map;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public static WritableMap fromMultiLineString(MultiLineString multiLineString) {
|
|
93
|
+
WritableMap map = Arguments.createMap();
|
|
94
|
+
map.putString("type", "MultiLineString");
|
|
95
|
+
map.putArray("coordinates", getCoordinates(multiLineString));
|
|
96
|
+
return map;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public static WritableMap fromMultiPolygon(MultiPolygon multiPolygon) {
|
|
100
|
+
WritableMap map = Arguments.createMap();
|
|
101
|
+
map.putString("type", "MultiPolygon");
|
|
102
|
+
map.putArray("coordinates", getCoordinates(multiPolygon));
|
|
103
|
+
return map;
|
|
104
|
+
}
|
|
105
|
+
|
|
77
106
|
public static WritableArray getCoordinates(Point point) {
|
|
78
107
|
return Arguments.fromArray(pointToDoubleArray(point));
|
|
79
108
|
}
|
|
@@ -110,6 +139,57 @@ public class GeoJSONUtils {
|
|
|
110
139
|
return array;
|
|
111
140
|
}
|
|
112
141
|
|
|
142
|
+
public static WritableArray getCoordinates(MultiPoint multiPoint) {
|
|
143
|
+
WritableArray array = Arguments.createArray();
|
|
144
|
+
|
|
145
|
+
List<Point> points = multiPoint.coordinates();
|
|
146
|
+
for (Point point : points) {
|
|
147
|
+
array.pushArray(Arguments.fromArray(pointToDoubleArray(point)));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return array;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public static WritableArray getCoordinates(MultiLineString multiLineString) {
|
|
154
|
+
WritableArray array = Arguments.createArray();
|
|
155
|
+
|
|
156
|
+
List<List<Point>> lines = multiLineString.coordinates();
|
|
157
|
+
for (List<Point> line : lines) {
|
|
158
|
+
WritableArray lineArray = Arguments.createArray();
|
|
159
|
+
|
|
160
|
+
for (Point point : line) {
|
|
161
|
+
lineArray.pushArray(Arguments.fromArray(pointToDoubleArray(point)));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
array.pushArray(lineArray);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return array;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public static WritableArray getCoordinates(MultiPolygon multiPolygon) {
|
|
171
|
+
WritableArray array = Arguments.createArray();
|
|
172
|
+
|
|
173
|
+
List<List<List<Point>>> polygons = multiPolygon.coordinates();
|
|
174
|
+
for (List<List<Point>> polygon : polygons) {
|
|
175
|
+
WritableArray polygonArray = Arguments.createArray();
|
|
176
|
+
|
|
177
|
+
for (List<Point> ring : polygon) {
|
|
178
|
+
WritableArray ringArray = Arguments.createArray();
|
|
179
|
+
|
|
180
|
+
for (Point point : ring) {
|
|
181
|
+
ringArray.pushArray(Arguments.fromArray(pointToDoubleArray(point)));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
polygonArray.pushArray(ringArray);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
array.pushArray(polygonArray);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return array;
|
|
191
|
+
}
|
|
192
|
+
|
|
113
193
|
public static WritableMap toPointFeature(LatLng latLng, WritableMap properties) {
|
|
114
194
|
WritableMap map = new WritableNativeMap();
|
|
115
195
|
map.putString("type", "Feature");
|
package/ios/MLRN/MLRNFillLayer.h
CHANGED
package/ios/MLRN/MLRNFillLayer.m
CHANGED
package/ios/MLRN/MLRNLineLayer.h
CHANGED
package/ios/MLRN/MLRNModule.m
CHANGED
|
@@ -71,120 +71,6 @@ RCT_EXPORT_MODULE();
|
|
|
71
71
|
NSMutableDictionary *styleSourceConsts = [[NSMutableDictionary alloc] init];
|
|
72
72
|
[styleSourceConsts setObject:DEFAULT_SOURCE_ID forKey:@"DefaultSourceID"];
|
|
73
73
|
|
|
74
|
-
// line layer constants
|
|
75
|
-
NSMutableDictionary *lineJoin = [[NSMutableDictionary alloc] init];
|
|
76
|
-
[lineJoin setObject:@(MLNLineJoinBevel) forKey:@"Bevel"];
|
|
77
|
-
[lineJoin setObject:@(MLNLineJoinRound) forKey:@"Round"];
|
|
78
|
-
[lineJoin setObject:@(MLNLineJoinMiter) forKey:@"Miter"];
|
|
79
|
-
|
|
80
|
-
NSMutableDictionary *lineCap = [[NSMutableDictionary alloc] init];
|
|
81
|
-
[lineCap setObject:@(MLNLineCapButt) forKey:@"Butt"];
|
|
82
|
-
[lineCap setObject:@(MLNLineCapRound) forKey:@"Round"];
|
|
83
|
-
[lineCap setObject:@(MLNLineCapSquare) forKey:@"Square"];
|
|
84
|
-
|
|
85
|
-
NSMutableDictionary *lineTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
86
|
-
[lineTranslateAnchor setObject:@(MLNLineTranslationAnchorMap) forKey:@"Map"];
|
|
87
|
-
[lineTranslateAnchor setObject:@(MLNLineTranslationAnchorViewport) forKey:@"Viewport"];
|
|
88
|
-
|
|
89
|
-
// circle layer constants
|
|
90
|
-
NSMutableDictionary *circlePitchScale = [[NSMutableDictionary alloc] init];
|
|
91
|
-
[circlePitchScale setObject:@(MLNCircleScaleAlignmentMap) forKey:@"Map"];
|
|
92
|
-
[circlePitchScale setObject:@(MLNCircleScaleAlignmentViewport) forKey:@"Viewport"];
|
|
93
|
-
|
|
94
|
-
NSMutableDictionary *circlePitchAlignment = [[NSMutableDictionary alloc] init];
|
|
95
|
-
[circlePitchAlignment setObject:@(MLNCirclePitchAlignmentMap) forKey:@"Map"];
|
|
96
|
-
[circlePitchAlignment setObject:@(MLNCirclePitchAlignmentViewport) forKey:@"Viewport"];
|
|
97
|
-
|
|
98
|
-
NSMutableDictionary *circleTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
99
|
-
[circleTranslateAnchor setObject:@(MLNCircleTranslationAnchorMap) forKey:@"Map"];
|
|
100
|
-
[circleTranslateAnchor setObject:@(MLNCircleTranslationAnchorViewport) forKey:@"Viewport"];
|
|
101
|
-
|
|
102
|
-
// fill extrusion layer constants
|
|
103
|
-
NSMutableDictionary *fillExtrusionTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
104
|
-
[fillExtrusionTranslateAnchor setObject:@(MLNFillExtrusionTranslationAnchorMap) forKey:@"Map"];
|
|
105
|
-
[fillExtrusionTranslateAnchor setObject:@(MLNFillExtrusionTranslationAnchorViewport) forKey:@"Viewport"];
|
|
106
|
-
|
|
107
|
-
// fill layer constants
|
|
108
|
-
NSMutableDictionary *fillTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
109
|
-
[fillTranslateAnchor setObject:@(MLNFillTranslationAnchorMap) forKey:@"Map"];
|
|
110
|
-
[fillTranslateAnchor setObject:@(MLNFillTranslationAnchorViewport) forKey:@"Viewport"];
|
|
111
|
-
|
|
112
|
-
// symbol layer constants
|
|
113
|
-
NSMutableDictionary *iconRotationAlignment = [[NSMutableDictionary alloc] init];
|
|
114
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentAuto) forKey:@"Auto"];
|
|
115
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentMap) forKey:@"Map"];
|
|
116
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentViewport) forKey:@"Viewport"];
|
|
117
|
-
|
|
118
|
-
NSMutableDictionary *iconTextFit = [[NSMutableDictionary alloc] init];
|
|
119
|
-
[iconTextFit setObject:@(MLNIconTextFitNone) forKey:@"None"];
|
|
120
|
-
[iconTextFit setObject:@(MLNIconTextFitWidth) forKey:@"Width"];
|
|
121
|
-
[iconTextFit setObject:@(MLNIconTextFitHeight) forKey:@"Height"];
|
|
122
|
-
[iconTextFit setObject:@(MLNIconTextFitBoth) forKey:@"Both"];
|
|
123
|
-
|
|
124
|
-
NSMutableDictionary *iconAnchor = [[NSMutableDictionary alloc] init];
|
|
125
|
-
[iconAnchor setObject:@(MLNIconAnchorCenter) forKey:@"Center"];
|
|
126
|
-
[iconAnchor setObject:@(MLNIconAnchorTop) forKey:@"Top"];
|
|
127
|
-
[iconAnchor setObject:@(MLNIconAnchorBottom) forKey:@"Bottom"];
|
|
128
|
-
[iconAnchor setObject:@(MLNIconAnchorLeft) forKey:@"Left"];
|
|
129
|
-
[iconAnchor setObject:@(MLNIconAnchorRight) forKey:@"Right"];
|
|
130
|
-
[iconAnchor setObject:@(MLNIconAnchorTopLeft) forKey:@"TopLeft"];
|
|
131
|
-
[iconAnchor setObject:@(MLNIconAnchorTopRight) forKey:@"TopRight"];
|
|
132
|
-
[iconAnchor setObject:@(MLNIconAnchorBottomLeft) forKey:@"BottomLeft"];
|
|
133
|
-
[iconAnchor setObject:@(MLNIconAnchorBottomRight) forKey:@"BottomRight"];
|
|
134
|
-
|
|
135
|
-
NSMutableDictionary *iconTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
136
|
-
[iconTranslateAnchor setObject:@(MLNIconTranslationAnchorMap) forKey:@"Map"];
|
|
137
|
-
[iconTranslateAnchor setObject:@(MLNIconTranslationAnchorViewport) forKey:@"Viewport"];
|
|
138
|
-
|
|
139
|
-
NSMutableDictionary *iconPitchAlignment = [[NSMutableDictionary alloc] init];
|
|
140
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentAuto) forKey:@"Auto"];
|
|
141
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentMap) forKey:@"Map"];
|
|
142
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentViewport) forKey:@"Viewport"];
|
|
143
|
-
|
|
144
|
-
NSMutableDictionary *symbolPlacement = [[NSMutableDictionary alloc] init];
|
|
145
|
-
[symbolPlacement setObject:@(MLNSymbolPlacementLine) forKey:@"Line"];
|
|
146
|
-
[symbolPlacement setObject:@(MLNSymbolPlacementPoint) forKey:@"Point"];
|
|
147
|
-
|
|
148
|
-
NSMutableDictionary *textAnchor = [[NSMutableDictionary alloc] init];
|
|
149
|
-
[textAnchor setObject:@(MLNTextAnchorCenter) forKey:@"Center"];
|
|
150
|
-
[textAnchor setObject:@(MLNTextAnchorLeft) forKey:@"Left"];
|
|
151
|
-
[textAnchor setObject:@(MLNTextAnchorRight) forKey:@"Right"];
|
|
152
|
-
[textAnchor setObject:@(MLNTextAnchorTop) forKey:@"Top"];
|
|
153
|
-
[textAnchor setObject:@(MLNTextAnchorBottom) forKey:@"Bottom"];
|
|
154
|
-
[textAnchor setObject:@(MLNTextAnchorTopLeft) forKey:@"TopLeft"];
|
|
155
|
-
[textAnchor setObject:@(MLNTextAnchorTopRight) forKey:@"TopRight"];
|
|
156
|
-
[textAnchor setObject:@(MLNTextAnchorBottomLeft) forKey:@"BottomLeft"];
|
|
157
|
-
[textAnchor setObject:@(MLNTextAnchorBottomRight) forKey:@"BottomRight"];
|
|
158
|
-
|
|
159
|
-
NSMutableDictionary *textJustify = [[NSMutableDictionary alloc] init];
|
|
160
|
-
[textJustify setObject:@(MLNTextJustificationCenter) forKey:@"Center"];
|
|
161
|
-
[textJustify setObject:@(MLNTextJustificationLeft) forKey:@"Left"];
|
|
162
|
-
[textJustify setObject:@(MLNTextJustificationRight) forKey:@"Right"];
|
|
163
|
-
|
|
164
|
-
NSMutableDictionary *textPitchAlignment = [[NSMutableDictionary alloc] init];
|
|
165
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentAuto) forKey:@"Auto"];
|
|
166
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentMap) forKey:@"Map"];
|
|
167
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentViewport) forKey:@"Viewport"];
|
|
168
|
-
|
|
169
|
-
NSMutableDictionary *textRotationAlignment = [[NSMutableDictionary alloc] init];
|
|
170
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentAuto) forKey:@"Auto"];
|
|
171
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentMap) forKey:@"Map"];
|
|
172
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentViewport) forKey:@"Viewport"];
|
|
173
|
-
|
|
174
|
-
NSMutableDictionary *textTransform = [[NSMutableDictionary alloc] init];
|
|
175
|
-
[textTransform setObject:@(MLNTextTransformNone) forKey:@"None"];
|
|
176
|
-
[textTransform setObject:@(MLNTextTransformLowercase) forKey:@"Lowercase"];
|
|
177
|
-
[textTransform setObject:@(MLNTextTransformUppercase) forKey:@"Uppercase"];
|
|
178
|
-
|
|
179
|
-
NSMutableDictionary *textTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
180
|
-
[textTranslateAnchor setObject:@(MLNTextTranslationAnchorMap) forKey:@"Map"];
|
|
181
|
-
[textTranslateAnchor setObject:@(MLNTextTranslationAnchorViewport) forKey:@"Viewport"];
|
|
182
|
-
|
|
183
|
-
// light constants
|
|
184
|
-
NSMutableDictionary *lightAnchor = [[NSMutableDictionary alloc] init];
|
|
185
|
-
[lightAnchor setObject:@(MLNLightAnchorMap) forKey:@"Map"];
|
|
186
|
-
[lightAnchor setObject:@(MLNLightAnchorViewport) forKey:@"Viewport"];
|
|
187
|
-
|
|
188
74
|
// offline module callback names
|
|
189
75
|
NSMutableDictionary *offlineModuleCallbackNames = [[NSMutableDictionary alloc] init];
|
|
190
76
|
[offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
|
|
@@ -202,27 +88,6 @@ RCT_EXPORT_MODULE();
|
|
|
202
88
|
@"UserLocationVerticalAlignment": userLocationVerticalAlignment,
|
|
203
89
|
@"CameraModes": cameraModes,
|
|
204
90
|
@"StyleSource": styleSourceConsts,
|
|
205
|
-
@"LineJoin": lineJoin,
|
|
206
|
-
@"LineCap": lineCap,
|
|
207
|
-
@"LineTranslateAnchor": lineTranslateAnchor,
|
|
208
|
-
@"CirclePitchScale": circlePitchScale,
|
|
209
|
-
@"CircleTranslateAnchor": circleTranslateAnchor,
|
|
210
|
-
@"CirclePitchAlignment": circlePitchAlignment,
|
|
211
|
-
@"FillExtrusionTranslateAnchor": fillExtrusionTranslateAnchor,
|
|
212
|
-
@"FillTranslateAnchor": fillTranslateAnchor,
|
|
213
|
-
@"IconRotationAlignment": iconRotationAlignment,
|
|
214
|
-
@"IconTextFit": iconTextFit,
|
|
215
|
-
@"IconTranslateAnchor": iconTranslateAnchor,
|
|
216
|
-
@"IconAnchor": iconAnchor,
|
|
217
|
-
@"IconPitchAlignment": iconPitchAlignment,
|
|
218
|
-
@"SymbolPlacement": symbolPlacement,
|
|
219
|
-
@"TextAnchor": textAnchor,
|
|
220
|
-
@"TextJustify": textJustify,
|
|
221
|
-
@"TextPitchAlignment": textPitchAlignment,
|
|
222
|
-
@"TextRotationAlignment": textRotationAlignment,
|
|
223
|
-
@"TextTransform": textTransform,
|
|
224
|
-
@"TextTranslateAnchor": textTranslateAnchor,
|
|
225
|
-
@"LightAnchor": lightAnchor,
|
|
226
91
|
@"OfflineCallbackName": offlineModuleCallbackNames,
|
|
227
92
|
@"OfflinePackDownloadState": offlinePackDownloadState,
|
|
228
93
|
@"LocationCallbackName": locationModuleEvents
|
|
@@ -31,15 +31,4 @@
|
|
|
31
31
|
|
|
32
32
|
- (double)getClusterExpansionZoom:(nonnull NSString *)featureJSON;
|
|
33
33
|
|
|
34
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
35
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterLeavesById:(nonnull NSNumber *)clusterId
|
|
36
|
-
number:(NSUInteger)number
|
|
37
|
-
offset:(NSUInteger)offset;
|
|
38
|
-
|
|
39
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
40
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterChildrenById:(nonnull NSNumber *)clusterId;
|
|
41
|
-
|
|
42
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
43
|
-
- (double)getClusterExpansionZoomById:(nonnull NSNumber *)clusterId;
|
|
44
|
-
|
|
45
34
|
@end
|
|
@@ -145,42 +145,4 @@ static UIImage * _placeHolderImage;
|
|
|
145
145
|
return [shapeSource childrenOfCluster:cluster];
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
150
|
-
- (double)getClusterExpansionZoomById:(nonnull NSNumber *)clusterId
|
|
151
|
-
{
|
|
152
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
153
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate: [NSPredicate predicateWithFormat:@"%K = %i", @"cluster_id", clusterId.intValue]];
|
|
154
|
-
if (features.count == 0) {
|
|
155
|
-
return -1;
|
|
156
|
-
}
|
|
157
|
-
return [shapeSource zoomLevelForExpandingCluster:(MLNPointFeatureCluster *)features[0]];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
161
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterLeavesById:(nonnull NSNumber *)clusterId
|
|
162
|
-
number:(NSUInteger)number
|
|
163
|
-
offset:(NSUInteger)offset
|
|
164
|
-
{
|
|
165
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
166
|
-
|
|
167
|
-
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"cluster_id == %@", clusterId];
|
|
168
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate:predicate];
|
|
169
|
-
|
|
170
|
-
MLNPointFeatureCluster * cluster = (MLNPointFeatureCluster *)features[0];
|
|
171
|
-
return [shapeSource leavesOfCluster:cluster offset:offset limit:number];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
175
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterChildrenById:(nonnull NSNumber *)clusterId
|
|
176
|
-
{
|
|
177
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
178
|
-
|
|
179
|
-
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"cluster_id == %@", clusterId];
|
|
180
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate:predicate];
|
|
181
|
-
|
|
182
|
-
MLNPointFeatureCluster * cluster = (MLNPointFeatureCluster *)features[0];
|
|
183
|
-
return [shapeSource childrenOfCluster:cluster];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
148
|
@end
|
|
@@ -128,72 +128,4 @@ RCT_EXPORT_METHOD(getClusterChildren:(nonnull NSNumber*)reactTag
|
|
|
128
128
|
}];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
132
|
-
RCT_EXPORT_METHOD(getClusterExpansionZoomById:(nonnull NSNumber*)reactTag
|
|
133
|
-
clusterId:(nonnull NSNumber*)clusterId
|
|
134
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
135
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
136
|
-
{
|
|
137
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
138
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
139
|
-
|
|
140
|
-
if (![shapeSource isKindOfClass:[MLRNShapeSource class]]) {
|
|
141
|
-
RCTLogError(@"Invalid react tag, could not find MLRNMapView");
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
double zoom = [shapeSource getClusterExpansionZoomById:clusterId];
|
|
146
|
-
if (zoom == -1) {
|
|
147
|
-
reject(@"zoom_error", [NSString stringWithFormat:@"Could not get zoom for cluster id %@", clusterId], nil);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
resolve(@{@"data":@(zoom)});
|
|
151
|
-
}];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
155
|
-
RCT_EXPORT_METHOD(getClusterLeavesById:(nonnull NSNumber*)reactTag
|
|
156
|
-
clusterId:(nonnull NSNumber *)clusterId
|
|
157
|
-
number:(NSUInteger) number
|
|
158
|
-
offset:(NSUInteger) offset
|
|
159
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
160
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
161
|
-
{
|
|
162
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
163
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
164
|
-
|
|
165
|
-
NSArray<id<MLNFeature>> *shapes = [shapeSource getClusterLeavesById:clusterId number:number offset:offset];
|
|
166
|
-
|
|
167
|
-
NSMutableArray<NSDictionary*> *features = [[NSMutableArray alloc] initWithCapacity:shapes.count];
|
|
168
|
-
for (int i = 0; i < shapes.count; i++) {
|
|
169
|
-
[features addObject:shapes[i].geoJSONDictionary];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
resolve(@{
|
|
173
|
-
@"data": @{ @"type": @"FeatureCollection", @"features": features }
|
|
174
|
-
});
|
|
175
|
-
}];
|
|
176
|
-
}
|
|
177
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
178
|
-
RCT_EXPORT_METHOD(getClusterChildrenById:(nonnull NSNumber*)reactTag
|
|
179
|
-
clusterId:(nonnull NSNumber *)clusterId
|
|
180
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
181
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
182
|
-
{
|
|
183
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
184
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
185
|
-
|
|
186
|
-
NSArray<id<MLNFeature>> *shapes = [shapeSource getClusterChildrenById: clusterId];
|
|
187
|
-
|
|
188
|
-
NSMutableArray<NSDictionary*> *features = [[NSMutableArray alloc] initWithCapacity:shapes.count];
|
|
189
|
-
for (int i = 0; i < shapes.count; i++) {
|
|
190
|
-
[features addObject:shapes[i].geoJSONDictionary];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
resolve(@{
|
|
194
|
-
@"data": @{ @"type": @"FeatureCollection", @"features": features }
|
|
195
|
-
});
|
|
196
|
-
}];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
131
|
@end
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
#import <React/RCTComponent.h>
|
|
2
1
|
#import "MLRNVectorLayer.h"
|
|
3
2
|
|
|
4
|
-
@interface MLRNSymbolLayer : MLRNVectorLayer
|
|
5
|
-
|
|
6
|
-
@property (nonatomic, strong) NSMutableArray<id<RCTComponent>> *reactSubviews;
|
|
7
|
-
|
|
8
|
-
@property (nonatomic, assign) BOOL snapshot;
|
|
9
|
-
@property (nonatomic, copy) NSString *sourceLayerID;
|
|
3
|
+
@interface MLRNSymbolLayer : MLRNVectorLayer
|
|
10
4
|
|
|
11
5
|
@end
|