private void UnbindPolyline(MapPolyline polyline) { polyline.PropertyChanged -= polyline_PropertyChanged; polyline.PositionChanged -= polyline_PositionChanged; }
private void RemovePolylineFromMap(MapPolyline polyline) { if (_polylines.ContainsKey(polyline)) { var line = _polylines[polyline]; // remove the old polyline from the map line.RemoveFromMap(); line.Dispose(); } }
private void RemovePolyline(MapPolyline polyline) { if (_polylines.ContainsKey(polyline) == false) return; RemovePolylineFromMap(polyline); _polylines.Remove(polyline); }
private PolylineOptions CreatePolylineOptions(MapPolyline polyline) { var op = new PolylineOptions(); op.InvokeColor(polyline.Color.ToAndroid().ToArgb()); op.InvokeWidth((float)polyline.Width); op.InvokeZIndex(polyline.ZIndex); return op; }
private void AddPolyline(MapPolyline polyline) { // add the new one using (var op = CreatePolylineOptions(polyline)) { foreach (var pt in polyline.Positions) { op.Add(pt); } // add the last polyline segment var line = PolylineAdv.Add(NativeMap, op); _polylines.Add(polyline, line); } }