Bug Report T125936
Visible to All Users

Adding map items at runtime does not update the map area

created 11 years ago

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

Answers approved by DevExpress Support

created 11 years ago

We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Comments (2)

      Hi I am having the same problem, but I am using a vectorLayer and C#, there is no definition for UpdateViewPort please assist with a fix for C#.
      thanks
      Graham

      DevExpress Support Team 11 years ago

        Hello Graham,

        I'm afraid this fix is for VCL controls. However, I've created a new thread about your issue - T131643: Map is not updating after adding polyline. Let's continue discussing the problem there.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.