"setAutoZoomExtra"
The GIS viewer can zoom to certain areas automatically by using functions like ZoomByVariableValue.
This zoom feature has an hard-coded default offset of 1.0 so that it won't zoom in too far. This offset can be changed.
Synopsis
void setAutoZoomExtra(string strLayer, double dxExtra);
Parameters
Parameter | Description |
---|---|
strLayer | The name of the layer for which the offset will be set. |
dxExtra |
The offset that will be set when zooming using the functions: ZoomByVariableValue ZoomByWildCard. |
Description
he GIS viewer can zoom to certain areas automatically by using functions like ZoomByVariableValue.
This zoom feature has an hard-coded default offset of 1.0 so that it won't zoom in too far. This offset can be changed by the function setAutoZoomExtra. You can set the offset higher or lower. The offset will be valid for the functions:
- updateShapeAndAutoZoom
- zoomByVariableValue
- zoomByWildCard
Example
The function will zoom by using the function ZoomByVariableValue and then set setAutoZoomExtra to 5. If you zoom after setting the
setAutoToomExtra to 5, you will notice that the offset will be bigger. Now there are 5 units ( degrees or meters depending whether you use
degrees or meters in your map) on all sides.
Assign the variable "Cit" to the two capitals Rome and Vienna and zoom to the them:
main()
{
GisViewer_ewo1.assignVariableToShape( "COUNTRY", "CAPITAL", "Roma", "Cit", 1) ;
GisViewer_ewo1.assignVariableToShape( "COUNTRY", "CAPITAL", "Vienna", "Cit", 1) ;
GisViewer_ewo1.zoomByWildcard("COUNTRY","Cit", "1",0,0);
}
Sets setAutoZoomExtra to 5:
main()
{
GisViewer_ewo1.setAutoZoomExtra("COUNTRY",5.0);
}
Now use the first code to zoom to the capital again. You will notice a bigger offset.
Assignment
GIS Viewer