@maplibre/maplibre-react-native 11.0.0-beta.30 → 11.0.0-beta.31

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 (21) hide show
  1. package/android/src/main/java/org/maplibre/reactnative/components/layer/MLRNLayer.kt +8 -8
  2. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.kt +60 -0
  3. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.kt +3005 -0
  4. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.kt +159 -0
  5. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +3 -1
  6. package/ios/components/layer/style/MLRNStyle.h +1 -1
  7. package/ios/components/layer/style/MLRNStyle.m +1 -1
  8. package/lib/commonjs/utils/getStylePropertyType.js +1 -1
  9. package/lib/module/utils/getStylePropertyType.js +1 -1
  10. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts +92 -59
  11. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts.map +1 -1
  12. package/lib/typescript/module/types/MapLibreRNStyles.d.ts +92 -59
  13. package/lib/typescript/module/types/MapLibreRNStyles.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/src/types/MapLibreRNStyles.ts +102 -119
  16. package/src/utils/getStylePropertyType.ts +1 -1
  17. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.java +0 -76
  18. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.java +0 -2285
  19. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFunctionParser.java +0 -94
  20. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.java +0 -207
  21. package/android/src/main/java/org/maplibre/reactnative/events/AndroidCallbackEvent.java +0 -34
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // DO NOT MODIFY
3
- // This file is auto-generated from scripts/src/templates/getStylePropertyType.ts.ejs
3
+ // This file is auto-generated from scripts/src/templates/renderGetStylePropertyType.ts
4
4
 
5
5
  import { isAndroid } from "./index";
6
6
 
@@ -1,76 +0,0 @@
1
- package org.maplibre.reactnative.components.layer.style;
2
-
3
- import android.content.Context;
4
- import androidx.annotation.NonNull;
5
-
6
- import com.facebook.react.bridge.ReadableMap;
7
- import com.facebook.react.bridge.ReadableMapKeySetIterator;
8
- import org.maplibre.android.maps.MapLibreMap;
9
- import org.maplibre.reactnative.utils.DownloadMapImageTask;
10
- import org.maplibre.reactnative.utils.ImageEntry;
11
-
12
- import java.util.AbstractMap;
13
- import java.util.ArrayList;
14
- import java.util.List;
15
- import java.util.Map;
16
-
17
- public class MLRNStyle {
18
- private Context mContext;
19
- private ReadableMap mReactStyle;
20
- private MapLibreMap mMap;
21
-
22
- public MLRNStyle(@NonNull Context context, @NonNull ReadableMap reactStyle, @NonNull MapLibreMap map) {
23
- mContext = context;
24
- mReactStyle = reactStyle;
25
- mMap = map;
26
- }
27
-
28
- public List<String> getAllStyleKeys() {
29
- if (mReactStyle == null) {
30
- return new ArrayList<>();
31
- }
32
-
33
- ReadableMapKeySetIterator it = mReactStyle.keySetIterator();
34
- List<String> keys = new ArrayList<>();
35
-
36
- while (it.hasNextKey()) {
37
- String key = it.nextKey();
38
- keys.add(key);
39
- }
40
-
41
- return keys;
42
- }
43
-
44
- public MLRNStyleValue getStyleValueForKey(String styleKey) {
45
- ReadableMap styleValueConfig = mReactStyle.getMap(styleKey);
46
-
47
- if (styleValueConfig == null) {
48
- // TODO: throw exeception here
49
- return null;
50
- }
51
-
52
- return new MLRNStyleValue(styleValueConfig);
53
- }
54
-
55
- public void addImage(MLRNStyleValue styleValue) {
56
- addImage(styleValue, null);
57
- }
58
-
59
- public ImageEntry imageEntry(MLRNStyleValue styleValue) {
60
- return new ImageEntry(styleValue.getImageURI(), styleValue.getImageScale(), false);
61
- }
62
-
63
- public void addImage(MLRNStyleValue styleValue, DownloadMapImageTask.OnAllImagesLoaded callback) {
64
- if (!styleValue.shouldAddImage()) {
65
- if (callback != null) {
66
- callback.onAllImagesLoaded();
67
- }
68
- return;
69
- }
70
-
71
- String uriStr = styleValue.getImageURI();
72
- Map.Entry[] images = new Map.Entry[]{ new AbstractMap.SimpleEntry(uriStr, imageEntry(styleValue)) };
73
- DownloadMapImageTask task = new DownloadMapImageTask(mContext, mMap, callback);
74
- task.execute(images);
75
- }
76
- }