Closed nitrag closed 3 years ago
Thank you @1ec5 for the acknowledgement of the issue and help with the workaround via Slack.
Confirmed no longer an issue in latest SDK.
Sorry, Never mind....Android implementation is working:
val followCircle = CircleLayer("follow_waypoints", followDataSource.id).apply {
withSourceLayer(Constant.Map.TileSets.Waypoints.title)
withProperties(
circleColor(Color.parseColor("#FF1A00")),
circleRadius(
interpolate(
exponential(1.5f), zoom(),
stop(4, 0.5f),
stop(8, 2f),
stop(10, 5f),
stop(12, 7f)
)
)
)
minZoom = 8f
maxZoom = 20f
setFilter(eq(get("trail_id"), 3237))
}
style.addLayer(followCircle)
val followCircleText = SymbolLayer("follow_waypoints_text", followDataSource.id).apply {
withSourceLayer(Constant.Map.TileSets.Waypoints.title)
withProperties(
textColor(Color.parseColor("#FFFFFF")),
textSize(12f),
textFont(arrayOf("Open Sans Bold", "Roboto Black")),
symbolPlacement(Property.SYMBOL_PLACEMENT_POINT),
textAllowOverlap(true),
textField(toString(get("position", properties())))
)
minZoom = 8f
maxZoom = 20f
setFilter(eq(get("trail_id"), 3237))
}
style.addLayer(followCircleText)
Platform: iOS Mapbox SDK version: 5.9
Steps to trigger behavior
position
(asInteger
). ("trail_id": 1029, "position": 1, "mile_marker": 0
)MGLSymbolStyleLayer
) layer that dynamicly styles text for each point.Expected behavior
Number/Integer attributes, when applied to
MGLSymbolStyleLayer.text
dynamic-styling are cast to String.Actual behavior
Attribute
position
with value1
becomestrue
.Other Notes
This issue does occur when using
MGLShapeSource
.followCircleText.text = NSExpression(forFunction: "castObject:toType:", arguments: [NSExpression(forKeyPath: "position"), "NSString"])
has no effect