-
Notifications
You must be signed in to change notification settings - Fork 1.3k
lineWithForPolylineAnnotation delegate not changing line width #15773
Comments
Hello - Thank you for your report. I haven't been able to reproduce this issue with iOS SDK v5.4.0. Can you confirm where you are setting the Code I usedoverride func viewDidLoad() {
super.viewDidLoad()
let mapView = MGLMapView(frame: view.bounds)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Set the map’s center coordinate and zoom level.
mapView.setCenter(CLLocationCoordinate2D(latitude: 59.31, longitude: 18.06), zoomLevel: 9, animated: false)
view.addSubview(mapView)
mapView.delegate = self
let coordinates = [mapView.visibleCoordinateBounds.ne, mapView.visibleCoordinateBounds.sw]
let annot = MGLPolyline(coordinates: coordinates, count: 2)
mapView.add(annot)
}
func mapView(_ mapView: MGLMapView, lineWidthForPolylineAnnotation annotation: MGLPolyline) -> CGFloat {
return 10
}
func mapView(_ mapView: MGLMapView, strokeColorForShapeAnnotation annotation: MGLShape) -> UIColor {
return .white
} |
This is the code i used class MEMMapController: UIViewController, MGLMapViewDelegate {
// mapView.maximumZoomLevel = minZoomForRegion
} |
But is not that the line does not appear, it does, but no way to change it`s width, i no longer have the code for the line style implementation but i does not work |
Thank you for the sample code @Arrodl. I see where you are adding an |
Yes |
This would be the implementation using the MGLPolylineFeature
|
? |
Hello - Could you clarify whether you are using both #15773 (comment) and #15773 (comment) in the same implementation, or separately? |
Same implementation |
Thank you for the additional information! If you would prefer to use If you continue to see this issue, a minimal test case that reproduces the issue would help us to troubleshoot. |
Closing as answered. |
Using the delegates for MGLPolyline is not changing the style of the Feature
Expected behavior
Line with should change sizes
Actual behavior
Line with is always same size, no matter the value given
Configuration
I´ve tried with the delegates, aswell as with style layers which results in mapView ignoring every kind of styles provided, even with the geojson and code provided in this example
https://docs.mapbox.com/ios/maps/examples/shape-collection/
Mapbox SDK versions: 5.4.0
iOS/macOS versions: 5.4.0
Device/simulator models: Physical devise iOS 13 iphone 7 32 GB
Xcode version: 11
The text was updated successfully, but these errors were encountered: