|
|
|
|
|
- Properties specific to MapPolygon variables
- WLanguage functions
MapPolygon (Variable type) In french: CartePolygone
The MapPolygon type is used to define the characteristics of a polygon to be drawn on the map displayed in a Map control. You can define and change the characteristics of this polygon using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MyPolygon is MapPolygon
FOR EACH PointPosition OF arrPositions
Add(MyPolygon.Point, PointPosition)
END
MyPolygon.LineColor = LightRed
MyPolygon.ActionClick = ClickProc
MapAddShape(MAP_MyMap, MyPolygon)
INTERNAL PROCEDURE ClickProc(p is MapPolygon)
ToastDisplay(StringBuild("Click on the <%1> polygon.", p.Name))
END
Properties Properties specific to MapPolygon variables The following properties can be used to handle a polygon: | | | Property name | Type used | Effect |
---|
ActionClick | Procedure name | Name of the WLanguage procedure called when the user clicks the polygon displayed in the Map control. This procedure has the following format:
PROCEDURE <Procedure name>(<Polygon>) where <Polygon> is a MapPolygon variable corresponding to the polygon that the user clicked on. If this property is not specified (or corresponds to an empty string ("")), no action will be performed on click. Note: it is advisable to use global procedures. If the procedure is a local procedure, it is necessary to prefix the procedure name with the full name of the object to which the procedure belongs (e.g. for a local window procedure: "FEN_Fenêtre1.MaProcedure"). | BackgroundColor | Color, integer, Integer constant | Polygon background color. This color can correspond to:Note: To change the fill opacity, write: MyMapPolygon.BackgroundColor.Opacity = 50
| Description | Character string | Description of the shape, used to store additional information, for example. | New in version 2025Extra | Variant | Allows you to store advanced information without affecting the execution of the application. You can store values of any type (array, etc.). It is also possible to add members to the Extra property. Example:
MyVariable.Extra.Info1 = Value MyVariable.Extra[Info2] = Value2 MyVariable.Extra.Date = DateSys() | Geodesic | Boolean | - True to indicate that the drawing of the polygon must take into account the curvature of the Earth,
- False (default) to draw a straight line.
| Line | Integer constant | Line style used between the vertices of the polygon: - ContinuousTrait (default): Solid line.
- Dotted line: Dotted line.
- TraitTiret: Dashes.
- MixedTrait: Dotted and dashed lines.
| LineColor | Color, integer, Integer constant | Polygon outline color. This color can correspond to: | Name | Character string | Name of the shape (here, name of the polygon). A name is automatically assigned when the variable is created. It can be modified, but it has to be unique if the shape is added to the Map control. This name can be used to delete the polygon with MapDeleteShape. | Point | Array of geoPosition | Points corresponding to the vertices of the polygon. The polygon will be automatically closed, so the start and end points can be different. | Thickness | Integer | Line thickness used for the polygon outline. The thickness is set to 2 by default. | ZOrder | Integer | Z-order of the circle in relation to the other shapes in the Map control. Allows you to manage overlays. A shape with a high Z-order will be drawn over a shape with a lower Z-order. This property is set to 0 by default. |
Remarks WLanguage functions The following WLanguage functions use MapPolygon variables:
| | MapAddShape | Adds a new shape (polygon, line, circle) to the map displayed in a Map control. | MapDeleteShape | Deletes a shape drawn on the map displayed in an Map control. | MapModifyShape | Modifies a shape drawn on the map displayed in a Map control. |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|