ZoomToExtent with Definition Query

Aug 8, 2011 at 4:10 PM
Hi
I am attempting to open a form to show one of two views.
View one is a table of geoms, on layer "image Layer", whose extent is limited by the second layer "image Layer2". (I use a box grid (100 boxes) to control the placing of images for display purposes.
View two is limited to one row by definitionQuery3.
View one is displayed properly through the RefreshMap2 code as shown below.
The second view shows blank. The compile doesn't seem to get beyond the ZoomToExtents in RefreshMap3 although it has no problem with the same code in RefreshMap2.
Perhaps, someone can point me to my problem?
Bob
public void RefreshMap2()
{
Thread.Sleep(1);
{
_sharpMap2.ZoomToExtents();
Image comp = _sharpMap2.GetMap();
picView.Image = comp;
}
}
private void RefreshMap3()
{
string definitionQuery3 = (GlobalClass3.comp_table + GlobalClass4.comp_row );
SetDefinitionQuery3OnLayer(_sharpMap2.Layers["image Layer"], definitionQuery3);
SetDefinitionQuery3OnLayer(_sharpMap2.Layers["image Layer2"], "library.box_grid.box_number=" + "'" + GlobalClass6.intp +"'");
_sharpMap2.ZoomToExtents()
Image comp2 = _sharpMap2.GetMap();
picView.Image = comp2;
Coordinator
Aug 9, 2011 at 8:54 AM

what kind of data source do you use?

Please try the GetExtents() function on _sharpMap2.Layers["image Layer"], and _sharpMap2.Layers["image Layer2"] which of the layers causes the problems.

Hth FObermaier

Aug 9, 2011 at 3:54 PM
Sorry, I thought that the problem was just something I wasn’t seeing in the code.
I connect to Postgis and am using SharpMap version 0.9
I am not familiar with the function GetExtent. Is is available in 0.9??
Bob
From: [email removed]
Sent: Tuesday, August 09, 2011 1:54 AM
To: [email removed]
Subject: Re: ZoomToExtent with Definition Query [SharpMap:268236]

From: FObermaier

what kind of data source do you use?

Please try the GetExtents() function on _sharpMap2.Layers["image Layer"], and _sharpMap2.Layers["image Layer2"] which of the layers causes the problems.

Hth FObermaier

Aug 9, 2011 at 4:01 PM
I commented out image layer2 and it seems to have been the problem.
Bob
From: [email removed]
Sent: Tuesday, August 09, 2011 1:54 AM
To: [email removed]
Subject: Re: ZoomToExtent with Definition Query [SharpMap:268236]

From: FObermaier

what kind of data source do you use?

Please try the GetExtents() function on _sharpMap2.Layers["image Layer"], and _sharpMap2.Layers["image Layer2"] which of the layers causes the problems.

Hth FObermaier

Aug 9, 2011 at 5:15 PM
Thanks FObermaier
I found the error – it was my blindness.
Bob
From: [email removed]
Sent: Tuesday, August 09, 2011 1:54 AM
To: [email removed]
Subject: Re: ZoomToExtent with Definition Query [SharpMap:268236]

From: FObermaier

what kind of data source do you use?

Please try the GetExtents() function on _sharpMap2.Layers["image Layer"], and _sharpMap2.Layers["image Layer2"] which of the layers causes the problems.

Hth FObermaier