Hello,
if I add a polyline to the dxMapControl with OpenStreetMap provider, the map does not show the polyline until I scroll the map.
C#procedure TForm2.Button1Click(Sender: TObject);
var AItemLayer : TdxMapItemLayer;
APolyline : TdxMapPolyline;
APoint : TdxMapControlGeoPointItem;
begin
dxMapControl1.Layers.BeginUpdate;
AItemLayer := dxMapControl1.AddItemLayer;
AItemLayer.MapItems.BeginUpdate;
AItemLayer.ItemStyle.BorderColor := dxColorToAlphaColor(clBlue);
APolyline := TdxMapPolyline(AItemLayer.AddItem(TdxMapPolyline));
APolyline.Style.BorderColor := dxColorToAlphaColor(clBlue);
APolyline.GeoPoints.BeginUpdate;
APoint := APolyline.GeoPoints.Add;
APoint.Latitude := 52;
APoint.Longitude := 8;
APoint := APolyline.GeoPoints.Add;
APoint.Latitude := 51;
APoint.Longitude := 7;
APolyline.GeoPoints.EndUpdate;
AItemLayer.MapItems.EndUpdate;
//dxMapControl1.Layers.UpdateViewPort;
dxMapControl1.Layers.EndUpdate;
end;
If I call dxMapControl1.Layers.UpdateViewPort the polyline shows up immediately, but I think this is not the supposed way. Am I missing something?
Best regards
Philipp