"addRectangleToLayer"
Adds a rectangle to a layer.
Synopsis
int addRectangleToLayer(string strLayer, string strName, double dX1, double dY1, double dX2, double dY2);
Parameters
Parameter | Description |
---|---|
strLayer | The name of the layer the rectangle will be added to. |
strName | The name of the rectangle that will be added. |
dX1 | Lower left corner of the rectangle (Longitude). |
dY1 | Latitude. |
dX2 | Upper right corner of the rectangle (Longitude). |
dY2 | Latitude. |
Description
Adds a rectangle to a layer.
Example
The function will add two rectangles one to Finland Helsinki and a second one to Milan, Italy.
The coordinates apply to a world map.
main()
{
/* Helsinki Finland longitude and latitude 25, 60,
Italy Milan longitude and latitude 9.2,45 */
GisViewer_ewo1.addEmptyLayer("Rectangles");
GisViewer_ewo1.setLayerFillColor("Rectangles","blue");
GisViewer_ewo1.addRectangleToLayer("Rectangles","RecLond",25,60,27,61.5);
GisViewer_ewo1.addRectangleToLayer("Rectangles","RecMilan",9.2,45,11,46);
}
The layer the rectangle will be added to must be a layer that was added using the function "addEmptyLayer". The function addRectangleToLayer() is not supported on an existing 'normal' layer.
Assignment
GIS Viewer