Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Polyline strokeWidth cannot be changed #55

@jay-cohen

Description

@jay-cohen

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions