@rnmapbox/maps 10.1.31 → 10.1.32-rc.1
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/android/build.gradle +3 -3
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +6 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/events/constants/EventKeys.kt +18 -16
- package/ios/RNMBX/RNMBXMapView.swift +34 -5
- package/package.json +1 -1
- package/rnmapbox-maps.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
def defaultMapboxMapsImpl = "mapbox"
|
|
2
|
-
def defaultMapboxMapsVersion = "10.18.
|
|
2
|
+
def defaultMapboxMapsVersion = "10.18.4"
|
|
3
3
|
|
|
4
4
|
def safeExtGet(prop, fallback) {
|
|
5
5
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
@@ -163,7 +163,7 @@ dependencies {
|
|
|
163
163
|
} else {
|
|
164
164
|
msg = '@rnmapbox/maps: RNMapboxMapsImpl has invalid value - only mapbox supported - see https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Maplibre#android'
|
|
165
165
|
logger.error(msg)
|
|
166
|
-
throw new GradleException(msg)
|
|
166
|
+
throw new GradleException(msg)
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -188,4 +188,4 @@ dependencies {
|
|
|
188
188
|
|
|
189
189
|
tasks.withType(Test).configureEach {
|
|
190
190
|
useJUnitPlatform()
|
|
191
|
-
}
|
|
191
|
+
}
|
|
@@ -5,6 +5,8 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
5
5
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
6
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
7
7
|
import com.facebook.react.viewmanagers.RNMBXRasterSourceManagerInterface
|
|
8
|
+
import com.rnmapbox.rnmbx.events.constants.EventKeys
|
|
9
|
+
import com.rnmapbox.rnmbx.events.constants.eventMapOf
|
|
8
10
|
import javax.annotation.Nonnull
|
|
9
11
|
|
|
10
12
|
class RNMBXRasterSourceManager(reactApplicationContext: ReactApplicationContext) :
|
|
@@ -26,7 +28,10 @@ class RNMBXRasterSourceManager(reactApplicationContext: ReactApplicationContext)
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
override fun customEvents(): Map<String, String>? {
|
|
29
|
-
return
|
|
31
|
+
return eventMapOf(
|
|
32
|
+
EventKeys.RASTER_SOURCE_LAYER_CLICK to "onMapboxRasterSourcePress",
|
|
33
|
+
EventKeys.MAP_ANDROID_CALLBACK to "onAndroidCallback"
|
|
34
|
+
)
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
companion object {
|
|
@@ -4,35 +4,37 @@ private fun ns(name: String): String {
|
|
|
4
4
|
val namespace = "rct.mapbox"
|
|
5
5
|
return String.format("%s.%s", namespace, name)
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
enum class EventKeys(val value: String) {
|
|
8
9
|
// map events
|
|
9
|
-
MAP_CLICK(
|
|
10
|
-
MAP_LONG_CLICK(
|
|
11
|
-
MAP_ONCHANGE(
|
|
12
|
-
MAP_ON_LOCATION_CHANGE(
|
|
13
|
-
MAP_ANDROID_CALLBACK(
|
|
14
|
-
MAP_USER_TRACKING_MODE_CHANGE(
|
|
10
|
+
MAP_CLICK("topPress"),
|
|
11
|
+
MAP_LONG_CLICK("topLongPress"),
|
|
12
|
+
MAP_ONCHANGE("topMapChange"),
|
|
13
|
+
MAP_ON_LOCATION_CHANGE("topLocationChange"),
|
|
14
|
+
MAP_ANDROID_CALLBACK("topAndroidCallback"),
|
|
15
|
+
MAP_USER_TRACKING_MODE_CHANGE("topUserTrackingModeChange"),
|
|
15
16
|
|
|
16
17
|
// point annotation events
|
|
17
|
-
POINT_ANNOTATION_SELECTED(
|
|
18
|
-
POINT_ANNOTATION_DESELECTED(
|
|
19
|
-
POINT_ANNOTATION_DRAG_START(
|
|
20
|
-
POINT_ANNOTATION_DRAG(
|
|
21
|
-
POINT_ANNOTATION_DRAG_END(
|
|
18
|
+
POINT_ANNOTATION_SELECTED("topMapboxPointAnnotationSelected"),
|
|
19
|
+
POINT_ANNOTATION_DESELECTED("topMapboxPointAnnotationDeselected"),
|
|
20
|
+
POINT_ANNOTATION_DRAG_START("topMapboxPointAnnotationDragStart"),
|
|
21
|
+
POINT_ANNOTATION_DRAG("topMapboxPointAnnotationDrag"),
|
|
22
|
+
POINT_ANNOTATION_DRAG_END("topMapboxPointAnnotationDragEnd"),
|
|
22
23
|
|
|
23
24
|
// source events
|
|
24
|
-
SHAPE_SOURCE_LAYER_CLICK(
|
|
25
|
-
VECTOR_SOURCE_LAYER_CLICK(
|
|
26
|
-
RASTER_SOURCE_LAYER_CLICK(
|
|
25
|
+
SHAPE_SOURCE_LAYER_CLICK("topMapboxShapeSourcePress"),
|
|
26
|
+
VECTOR_SOURCE_LAYER_CLICK("topMapboxVectorSourcePress"),
|
|
27
|
+
RASTER_SOURCE_LAYER_CLICK("topMapboxRasterSourcePress"),
|
|
27
28
|
|
|
28
29
|
// images event
|
|
29
|
-
IMAGES_MISSING(
|
|
30
|
+
IMAGES_MISSING("topImageMissing"),
|
|
30
31
|
|
|
31
32
|
// location events
|
|
33
|
+
// TODO: not sure about this one since it is not registered anywhere
|
|
32
34
|
USER_LOCATION_UPDATE(ns("user.location.update")),
|
|
33
35
|
|
|
34
36
|
// viewport events
|
|
35
|
-
VIEWPORT_STATUS_CHANGE(
|
|
37
|
+
VIEWPORT_STATUS_CHANGE("topStatusChanged")
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
fun eventMapOf(vararg values: Pair<EventKeys, String>): Map<String, String> {
|
|
@@ -1416,6 +1416,32 @@ extension RNMBXMapView {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
1418
|
|
|
1419
|
+
typealias LayerSourceDetails = (source: String?, sourceLayer: String?)
|
|
1420
|
+
|
|
1421
|
+
#if RNMBX_11
|
|
1422
|
+
func getLayerSourceDetails(layer: (any Layer)?) -> LayerSourceDetails? {
|
|
1423
|
+
if let circleLayer = layer as? CircleLayer {
|
|
1424
|
+
return (circleLayer.source, circleLayer.sourceLayer)
|
|
1425
|
+
} else if let fillExtrusionLayer = layer as? FillExtrusionLayer {
|
|
1426
|
+
return (fillExtrusionLayer.source, fillExtrusionLayer.sourceLayer)
|
|
1427
|
+
} else if let fillLayer = layer as? FillLayer {
|
|
1428
|
+
return (fillLayer.source, fillLayer.sourceLayer)
|
|
1429
|
+
} else if let heatmapLayer = layer as? HeatmapLayer {
|
|
1430
|
+
return (heatmapLayer.source, heatmapLayer.sourceLayer)
|
|
1431
|
+
} else if let hillshadeLayer = layer as? HillshadeLayer {
|
|
1432
|
+
return (hillshadeLayer.source, hillshadeLayer.sourceLayer)
|
|
1433
|
+
} else if let lineLayer = layer as? LineLayer {
|
|
1434
|
+
return (lineLayer.source, lineLayer.sourceLayer)
|
|
1435
|
+
} else if let rasterLayer = layer as? RasterLayer {
|
|
1436
|
+
return (rasterLayer.source, rasterLayer.sourceLayer)
|
|
1437
|
+
} else if let symbolLayer = layer as? SymbolLayer {
|
|
1438
|
+
return (symbolLayer.source, symbolLayer.sourceLayer)
|
|
1439
|
+
} else {
|
|
1440
|
+
return nil
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
#endif
|
|
1444
|
+
|
|
1419
1445
|
extension RNMBXMapView {
|
|
1420
1446
|
func setSourceVisibility(_ visible: Bool, sourceId: String, sourceLayerId: String?) -> Void {
|
|
1421
1447
|
let style = self.mapboxMap.style
|
|
@@ -1424,14 +1450,18 @@ extension RNMBXMapView {
|
|
|
1424
1450
|
let layer = logged("setSourceVisibility.layer", info: { "\(layerInfo.id)" }) {
|
|
1425
1451
|
try style.layer(withId: layerInfo.id)
|
|
1426
1452
|
}
|
|
1453
|
+
|
|
1427
1454
|
#if RNMBX_11
|
|
1428
|
-
|
|
1455
|
+
let sourceDetails = getLayerSourceDetails(layer: layer)
|
|
1429
1456
|
#else
|
|
1430
|
-
|
|
1431
|
-
|
|
1457
|
+
let sourceDetails: LayerSourceDetails? = (source: layer?.source, sourceLayer: layer?.sourceLayer)
|
|
1458
|
+
#endif
|
|
1459
|
+
|
|
1460
|
+
if let layer = layer, let sourceDetails = sourceDetails {
|
|
1461
|
+
if sourceDetails.source == sourceId {
|
|
1432
1462
|
var good = true
|
|
1433
1463
|
if let sourceLayerId = sourceLayerId {
|
|
1434
|
-
if sourceLayerId !=
|
|
1464
|
+
if sourceLayerId != sourceDetails.sourceLayer {
|
|
1435
1465
|
good = false
|
|
1436
1466
|
}
|
|
1437
1467
|
}
|
|
@@ -1444,7 +1474,6 @@ extension RNMBXMapView {
|
|
|
1444
1474
|
}
|
|
1445
1475
|
}
|
|
1446
1476
|
}
|
|
1447
|
-
#endif
|
|
1448
1477
|
}
|
|
1449
1478
|
}
|
|
1450
1479
|
}
|
package/package.json
CHANGED
package/rnmapbox-maps.podspec
CHANGED
|
@@ -20,7 +20,7 @@ require 'json'
|
|
|
20
20
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
21
21
|
|
|
22
22
|
## Warning: these lines are scanned by autogenerate.js
|
|
23
|
-
rnMapboxMapsDefaultMapboxVersion = '~> 10.
|
|
23
|
+
rnMapboxMapsDefaultMapboxVersion = '~> 10.19.0'
|
|
24
24
|
|
|
25
25
|
rnMapboxMapsDefaultImpl = 'mapbox'
|
|
26
26
|
|