microsoft / MapsSDK-Native

This repository contains samples, documentation and releases history for the Bing Maps SDK for Android and iOS.
MIT License
40 stars 23 forks source link

Polyline strokeWidth cannot be changed #55

Open jay-cohen opened 2 years ago

jay-cohen commented 2 years ago

Using the example from the following Microsoft article the strokeWidth cannot be overridden.

Link to article

func drawLineOnMap() {
    let center = self.mapView.mapCenter.position

    let geopath = MSGeopath(positions:
        [MSGeoposition(latitude: center.latitude-0.0005, longitude: center.longitude-0.001),
         MSGeoposition(latitude: center.latitude+0.0005, longitude: center.longitude+0.001)])

    let mapPolyline = MSMapPolyline()
    mapPolyline.path = geopath
    mapPolyline.strokeColor = UIColor.black
    mapPolyline.strokeWidth = 3 // 3 marked in the example but always reverts to 1
    mapPolyline.strokeDashed = true

    // Add Polyline to a layer on the map control.
    let linesLayer = MSMapElementLayer()
    linesLayer.zIndex = 1
    linesLayer.elements.add(mapPolyline)
    mapView.layers.add(linesLayer);
}
jay-cohen commented 2 years ago

Update: This is only affecting 1st generation iPad devices. Edge case tolerance?