@rnmapbox/maps 10.0.8 → 10.0.9-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/rctmgl/build.gradle +1 -1
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +10 -1
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/events/constants/EventTypes.kt +1 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLModule.kt +1 -0
- package/ios/RCTMGL-v10/RCTMGLMapView.swift +11 -1
- package/package.json +1 -1
- package/rnmapbox-maps.podspec +1 -1
package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt
CHANGED
|
@@ -22,6 +22,7 @@ import com.mapbox.geojson.Point
|
|
|
22
22
|
import com.mapbox.maps.*
|
|
23
23
|
import com.mapbox.maps.extension.localization.localizeLabels
|
|
24
24
|
import com.mapbox.maps.extension.observable.eventdata.MapLoadingErrorEventData
|
|
25
|
+
import com.mapbox.maps.extension.observable.getMapLoadingErrorEventData
|
|
25
26
|
import com.mapbox.maps.extension.style.expressions.generated.Expression
|
|
26
27
|
import com.mapbox.maps.extension.style.layers.Layer
|
|
27
28
|
import com.mapbox.maps.extension.style.layers.generated.*
|
|
@@ -354,7 +355,15 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
|
|
|
354
355
|
}
|
|
355
356
|
})
|
|
356
357
|
|
|
357
|
-
map.subscribe({ event ->
|
|
358
|
+
map.subscribe({ event ->
|
|
359
|
+
Logger.e(LOG_TAG, String.format("Map load failed: %s", event.data.toString()))
|
|
360
|
+
val errorMessage = event.getMapLoadingErrorEventData().message
|
|
361
|
+
val event = MapChangeEvent(this, EventTypes.MAP_LOADING_ERROR, writableMapOf(
|
|
362
|
+
"error" to errorMessage
|
|
363
|
+
))
|
|
364
|
+
mManager.handleEvent(event)
|
|
365
|
+
|
|
366
|
+
}, Arrays.asList(MapEvents.MAP_LOADING_ERROR))
|
|
358
367
|
}
|
|
359
368
|
|
|
360
369
|
fun<T> mapGestureBegin(type:MapGestureType, gesture: T) {
|
|
@@ -21,6 +21,7 @@ object EventTypes {
|
|
|
21
21
|
const val DID_FINISH_RENDERING_MAP = "didfinishrenderingmap"
|
|
22
22
|
const val DID_FINISH_RENDERING_MAP_FULLY = "didfinishrenderingmapfully"
|
|
23
23
|
const val DID_FINISH_LOADING_STYLE = "didfinishloadingstyle"
|
|
24
|
+
const val MAP_LOADING_ERROR = "maploadingerror"
|
|
24
25
|
|
|
25
26
|
// point annotation event types
|
|
26
27
|
const val ANNOTATION_SELECTED = "annotationselected"
|
|
@@ -69,6 +69,7 @@ class RCTMGLModule(private val mReactContext: ReactApplicationContext) : ReactCo
|
|
|
69
69
|
eventTypes["DidFinishRenderingMap"] = EventTypes.DID_FINISH_RENDERING_MAP
|
|
70
70
|
eventTypes["DidFinishRenderingMapFully"] = EventTypes.DID_FINISH_RENDERING_MAP_FULLY
|
|
71
71
|
eventTypes["DidFinishLoadingStyle"] = EventTypes.DID_FINISH_LOADING_STYLE
|
|
72
|
+
eventTypes["MapLoadingError"] = EventTypes.MAP_LOADING_ERROR
|
|
72
73
|
|
|
73
74
|
// style source constants
|
|
74
75
|
val styleSourceConsts: MutableMap<String, String> = HashMap()
|
|
@@ -21,6 +21,11 @@ class RCTMGLCameraChanged : RCTMGLEvent, RCTEvent {
|
|
|
21
21
|
return newEvent
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
@objc
|
|
25
|
+
var coalescingKey: UInt16 {
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
static func moduleDotMethod() -> String! {
|
|
25
30
|
"RCTEventEmitter.receiveEvent"
|
|
26
31
|
}
|
|
@@ -335,7 +340,12 @@ open class RCTMGLMapView : MapView {
|
|
|
335
340
|
self.styleLoaded = false
|
|
336
341
|
if let value = value {
|
|
337
342
|
if let _ = URL(string: value) {
|
|
338
|
-
|
|
343
|
+
if let styleURI = StyleURI(rawValue: value) {
|
|
344
|
+
mapView.mapboxMap.loadStyleURI(styleURI)
|
|
345
|
+
} else {
|
|
346
|
+
let event = RCTMGLEvent(type:.mapLoadingError, payload: ["error": "invalid URI: \(value)"]);
|
|
347
|
+
self.fireEvent(event: event, callback: self.reactOnMapChange)
|
|
348
|
+
}
|
|
339
349
|
} else {
|
|
340
350
|
if RCTJSONParse(value, nil) != nil {
|
|
341
351
|
mapView.mapboxMap.loadStyleJSON(value)
|
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.14.0'
|
|
24
24
|
rnMapboxMapsDefaultMapboxGLVersion = '~> 5.9.0'
|
|
25
25
|
rnMapboxMapsDefaultMapLibreVersion = 'exactVersion 5.12.1'
|
|
26
26
|
|