Comments (3)
@mattijsf thanks for the report. Not yet looked into, does ["literal", [...]]
works?
from maps.
Yes @mfazekas that works! Good to have a workaround available!
I just checked the Android's RCTMGLStyleFactory
there we use the following logic:
public static void setLineDasharray(LineLayer layer, RCTMGLStyleValue styleValue) {
if (styleValue.isExpression()) {
layer.setProperties(PropertyFactory.lineDasharray(styleValue.getExpression()));
} else {
layer.setProperties(PropertyFactory.lineDasharray(styleValue.getFloatArray(VALUE_KEY)));
}
}
Seems like we could use a similar isExpression
technique on iOS to map it towards a plain array instead.
from maps.
- (NSExpression *)mglStyleValue`
{
...
...
} else if ([expressionJSON respondsToSelector:@selector(objectEnumerator)] && [[[(NSArray*)expressionJSON objectEnumerator] nextObject] isKindOfClass:[NSNumber class]]) {
return [NSExpression expressionForConstantValue:expressionJSON];
} else {
return [NSExpression expressionWithMGLJSONObject:expressionJSON];
}
}
This expressionForConstantValue:expressionJSON
addition in RCTMGLStyleValue.m
works for the lineDashPattern
case. My idea was that when the first element of the expression (array) is a number we can safely assume it is an array of constant values.
iconTextFitPadding
is special since it needs to be an instance of UIEdgeInsets
so extending styleExtras
in styleMap.js
with a extra entry: iconTextFitPadding: { iosType: 'edgeinsets' }
will do the trick.
If you would like. I could create a PR for these changes. I also noticed the edgeinsets
check in RCTMGLStyleValue.mglStyleValue
is broken. It should check for the presence of an array.
from maps.
Related Issues (20)
- [Bug]: iOS: Can only change pitch or heading via setCamera when centerCoordinate is specified
- [Bug]: Task :app:checkDebugDuplicateClasses FAILED HOT 4
- [Bug]: Crash when changing Annotations source state in iOS
- [Bug]: Map is not usable in a (horizontal) ScrollView on Android HOT 4
- Crash on latest version on iOS (getZoom) HOT 1
- [Bug]: Image marker as SymbolLayer in ShapeSource does not appear on long press event
- [Bug]: iOS PointAnnotation need to "longpress" before you can start dragging it on the map, on Android you can drag immediately after Press/Tap HOT 1
- [Bug]: queryRenderedFeaturesAtPoint is inconsistent when using onLongPress on MapView
- [Bug]: TypeScript style props exports not working properly HOT 3
- Support for iOS 12.4 with Mapbox Maps SDK v11 HOT 2
- [Bug]: Custom Styles on iOS HOT 1
- [Bug]: LocationPuck topImage inconsistent with iOS HOT 1
- [Bug]: marker views not propagating press events from their children HOT 1
- [Bug]: App is crashing with large data of features. Mainly with points HOT 1
- [Bug]: App is crashing with large data of features. Mainly with points
- Crash on android when loading ImageSource from image uri HOT 1
- [Bug]: iOS topImage inconsistent rendering
- Updating mapbox-maps-ios to 10.17.0 - May 1st iOS Privacy Manifest issue HOT 20
- [Bug]: Setting 'defaultSettings' on '<Mapbox.Camera />' showing the wrong location on very first render of the app HOT 1
- [Bug]: Sibling MarkerViews not observing zIndex style property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maps.