ZoomToMaxExtents method has no effect

Nov 16, 2012 at 8:11 AM
Edited Nov 16, 2012 at 8:15 AM

Hellow.

I am trying to create map application by MapWinGIS under Embarcadero RAD Studio C++. I am using final version of MapWinGIS.

In code below I am drawing points and lines and they are drawn correct. After that I called ZoomToMaxExtents() method of Map control but there is no effect. I am called also ZoomToLayer, but result is the same. Where is the problem?

  TMap* Map = Form1->Map1;
  Map->CursorMode = Mapwingis_tlb::tkCursorMode::cmNone;
  Map->ClearDrawings();
  int DrawingLayerHandle =  Map->NewDrawing(Mapwingis_tlb::tkDrawReferenceList::dlSpatiallyReferencedList);
  Map->DrawPointEx(DrawingLayerHandle, 0.0, 0.0, 5, 0);
  Map->DrawPointEx(DrawingLayerHandle, 0.2, 0.2, 5, 0);
  Map->DrawPointEx(DrawingLayerHandle, 0.2, 0.1, 5, 0);
  Map->DrawLineEx(DrawingLayerHandle, 0.0, 0.0, 0.2, 0.1, 1, 0);
  Map->DrawLineEx(DrawingLayerHandle, 0.2, 0.1, 0.2, 0.2, 1, 0);
  Map->ZoomToMaxExtents(); //There is no effect after this operator.

Thank you in advance.

Coordinator
Nov 19, 2012 at 6:25 AM
Edited Nov 19, 2012 at 6:33 AM

I think this is because you are using a drawing layer not a 'real' layer.

Can you try of ZoomToLayer() is working for you?

[Edit:]
I see you tried ZoomToLayer() already. I think you need at least one 'real' layer. Can't you add an in-memory shapefile?

--
Paul