Below is my code snippet which i am using to get location update in app.
Initially i wasn't able to adjust location pin size but later i found that if i give some value as a String to "scaleExpression" it changes the size of pin.
But it works only on android devices. On iOS device app gets crash with error().
This is code which i am using in my app.
mapboxMap.location.updateSettings(LocationComponentSettings( enabled: true, // puckBearingEnabled: true, puckBearingSource: PuckBearingSource.COURSE, locationPuck: LocationPuck( locationPuck2D: LocationPuck2D( bearingImage: null, shadowImage: null, topImage: list, scaleExpression: '2')), ));
This is Error msg getting while app crash on iOS Device.
mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) frame #0: 0x0000000186a9bebc libswiftCore.dylib_swift_runtime_on_report
libswiftCore.dylib: -> 0x186a9bebc <+0>: ret libswiftCore.dylib:
0x186a9bec0 <+0>: b 0x186a9bebc ; _swift_runtime_on_report
libswiftCore.dylib: 0x186a9bec4 <+0>: adrp x8, 462002 0x186a9bec8 <+4>: ldrb w0, [x8, #0x2cc] Target 0: (Runner) stopped.
Below is my code snippet which i am using to get location update in app. Initially i wasn't able to adjust location pin size but later i found that if i give some value as a String to "scaleExpression" it changes the size of pin. But it works only on android devices. On iOS device app gets crash with error().
This is code which i am using in my app.
mapboxMap.location.updateSettings(LocationComponentSettings( enabled: true, // puckBearingEnabled: true, puckBearingSource: PuckBearingSource.COURSE, locationPuck: LocationPuck( locationPuck2D: LocationPuck2D( bearingImage: null, shadowImage: null, topImage: list, scaleExpression: '2')), ));
This is Error msg getting while app crash on iOS Device.
mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) frame #0: 0x0000000186a9bebc libswiftCore.dylib
_swift_runtime_on_report libswiftCore.dylib: -> 0x186a9bebc <+0>: ret libswiftCore.dylib
: 0x186a9bec0 <+0>: b 0x186a9bebc ; _swift_runtime_on_report libswiftCore.dylib: 0x186a9bec4 <+0>: adrp x8, 462002 0x186a9bec8 <+4>: ldrb w0, [x8, #0x2cc] Target 0: (Runner) stopped.