my requirement is similar as you can see in below link as references (How make polygon without intersection in Swift)
But this solution is in google map sdk, i want same solution in bing map. Please help anyone. i am using below code....
`
func addPin(atLocation location: MSGeopoint, withTitle title: String) {
let pushpin = MSMapIcon()
pushpin.location = location
pushpin.title = title
if self.pinImage != nil {
pushpin.image = self.pinImage
pushpin.normalizedAnchorPoint = CGPoint(x: 0.5, y: 1.0)
}
//******************** my code to draw line between pin
let position = MSGeoposition(latitude: location.position.latitude, longitude: location.position.longitude)
positions.append(position)
highlightArea(position: positions)
//****************************
pushpin.accessibilityLabel = "Pushpin"
if title.isEmpty {
untitledPushpinCount += 1;
pushpin.accessibilityValue = String(format: "Untitled %d", untitledPushpinCount);
} else {
pushpin.accessibilityValue = title;
}
self.pinLayer.elements.add(pushpin)
}
//*********************** my code to draw line between pin
func highlightArea(position: [MSGeoposition]) {
let geopath = MSGeopath(positions:position)
//for polygon draw
let mapPolygon = MSMapPolygon()
mapPolygon.paths = [geopath]
mapPolygon.zIndex = 1
mapPolygon.fillColor = .clear//.red.withAlphaComponent(0.1)
mapPolygon.strokeColor = .blue
mapPolygon.strokeWidth = 1
mapPolygon.strokeDashed = true
let highlightsLayer = MSMapElementLayer()
highlightsLayer.zIndex = 1
highlightsLayer.elements.add(mapPolygon)
mapView.layers.add(highlightsLayer)
//for polyline draw
/* let mapPolyline = MSMapPolyline()
mapPolyline.path = geopath
mapPolyline.strokeColor = UIColor.black
mapPolyline.strokeWidth = 1
mapPolyline.strokeDashed = false
// Add Polyline to a layer on the map control.
let linesLayer = MSMapElementLayer()
linesLayer.zIndex = 1
linesLayer.elements.add(mapPolyline)
mapView.layers.add(linesLayer);
*/
}
`