Circle
-
Description
Circle
The component Circle displays a circle of a given radius, in meters, latitude and longitude and concrete needs of the Map component. The appearance of the circle can be custom using the properties 'Fill color', 'Stroke color' and ' Width stroke'.
The component Circle can also be used to implement functions such as Geofencing, a mechanism where the presence of the user within an area is used to trigger other behaviors.
When using the procedure 'Distance to point' combined with the Location Sensor, you can determine if the location of a user is within a or outside of the circle, being able to use this feature for triggering actions additional. -
Events
- On click
- Event that runs when you click on the circle.
- Drag
- Event that runs when you do drag actions on the circle.
- On long click
- Event that runs when you do a long click on the circle but without triggering a drag. Therefore, for this procedure to run the the property 'Draggable' must be false.
- Start drag
- Event that is executed before a drag operation begins. For example you can use this event to save the current position of the circle.
- Stop drag
- Event that is executed after the drag operation has been completed. For example you can use this event to save the new position of the circle.
-
Procedures
- Distance to feature
- This method calculates the distance between the Circle and the
characteristic of
given map. If 'centroids' is true, the calculation is made between the centroids of the two
characteristics. Otherwise, the distance will be calculated between the two characteristics
depending on the closest points.
If 'centroids' is false, this method will return 0 if the circle intersects or contains the introduced character. If it happens an error, this method will return -1.
- Distance to point
- This method calculates the distance between the Circle and the latitude
and
given length. If 'centroids' is true, the distance is calculated from the center of the
circle
up to the given point. Otherwise, the distance is calculated from the nearest point in the
circle to the given point.
If 'centroids' is false and the point is in the circle, this method will return 0. If an error occurs, -1 will be returned.
- Show information box
- This method shows the information box for the circle if it is not visible. Otherwise, this method has no effect. This method can be used to display the information box even if the 'Enable Information Box' property is false.
- Hide information box
- This method hides the information box of the circle if it is visible. Otherwise, no action is taken.
- Set location
- This method moves the center of the circle to latitude and longitude specified. This method is more efficient than setting the latitude and longitude separately.
-
Properties
- Description (Text)
- It allows to establish or obtain the description that is shown in the window of information. The information window appears when the user touches the circle.
- Draggable (boolean)
- It allows to establish or obtain if the user can or not drag a Map function. This function is accessed by long pressing and then dragging the circle to a new location.
- Enable information box (boolean)
- This property enables or disables the display of the window of the Information box when the user touches the circle.
- Fill color (color)
- This property sets or obtains the color used to complete the circle.
- Latitude (number)
- This property establishes or obtains the latitude of the center of the circle, in degrees. Positive values are represented north of the equator and negative values they represent south of the equator. To update the latitude and longitude simultaneously, use the 'Set location' procedure.
- Longitude (number)
- This property establishes or obtains the length of the center of the circle, in degrees.The positive values represent the east of the main meridian and values Negative represent the west of the main meridian. To update the latitude and length simultaneously, use the 'Set location' procedure.
- Radius (number)
- This property sets or obtains the radius of the circle, in meters.
- Stroke color (color)
- This property sets or obtains the color used to delineate the circle.
- Stroke width (number)
- This property sets or obtains the width of the stroke used to delineate the circle.
- Title (text)
- This property establishes or obtains the title that is displayed in the window of information that appears when the user clicks on the map function.
- Type (text)
- Gets the type of the characteristic. For a circle, the type will always be "Circle."
- Visible
- This property establishes or obtains if the component should be visible in the screen. The value is true if the component is displayed and false if it is hidden.