Rectangle

Last Updated On 2021-07-16

Version 2MinSDK 7Tutorial Video

Rectangle


Properties

You can set the below properties in the UI part of the builder.

  • Description - it's a text value which is set to blank by default.
  • Draggable - it's a boolean value which is set to false by default.
  • EastLongitude - it's a float value which is set to 0 by default.
  • EnableInfobox - it's a boolean value which is set to false by default.
  • FillColor - it's a color value which is set to &hffff0000 by default.
  • FillOpacity - it's a float value which is set to 1.0 by default.
  • NorthLatitude - it's a float value which is set to 0 by default.
  • SouthLatitude - it's a float value which is set to 0 by default.
  • StrokeColor - it's a color value which is set to &hff000000 by default.
  • StrokeOpacity - it's a float value which is set to 1.0 by default.
  • StrokeWidth - it's a integer value which is set to 1 by default.
  • Title - it's a text value which is set to blank by default.
  • Visible - it's a visibility value which is set to true by default.
  • WestLongitude - it's a float value which is set to 0 by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

Description

The description displayed in the info window that appears when the user clicks on the Rectangle.


Draggable

The Draggable property is used to set whether or not the user can drag the Rectangle by long-pressing and then dragging the Rectangle to a new location.


EastLongitude

The east edge of the rectangle, in decimal degrees east of the prime meridian.


EnableInfobox

Enable or disable the infobox window display when the user taps the Rectangle.


FillColor

The paint color used to fill in the Rectangle.


FillOpacity

The opacity of the interior of the map feature.


NorthLatitude

The north edge of the rectangle, in decimal degrees north of the equator.


SouthLatitude

The south edge of the rectangle, in decimal degrees north of the equator.


StrokeColor

The paint color used to outline the Rectangle.


StrokeOpacity

The opacity of the stroke used to outline the map feature.


StrokeWidth

The width of the stroke used to outline the Rectangle.


Title

The title displayed in the info window that appears when the user clicks on the Rectangle.


Type

Returns the type of the feature. For rectangles, this returns MapFeature.Rectangle ("Rectangle").


Visible

Specifies whether the Rectangle should be visible on the screen. Value is true if the component is showing and false if hidden.


WestLongitude

The west edge of the rectangle, in decimal degrees east of the equator.



Methods

You can set the below method blocks in the blocks section of the builder.

Bounds

Returns the bounding box of the Rectangle in the format ((North West) (South East)).

Center

Returns the center of the Rectangle as a list of the form (Latitude Longitude).

DistanceToFeature

Compute the distance, in meters, between two map features.

DistanceToPoint

Compute the distance, in meters, between a Rectangle and a latitude, longitude point.

HideInfobox

Hide the infobox if it is shown. If the infobox is not visible this function has no effect.

SetCenter

Moves the Rectangle so that it is centered on the given latitude and longitude while attempting to maintain the width and height of the Rectangle as measured from the center to the edges.

ShowInfobox

Show the infobox for the Rectangle. This will show the infobox even if EnableInfobox is set to false.


Events

You can set the below event blocks in the blocks section of the builder.

Click

The user clicked on the Rectangle.

Drag

The user dragged the Rectangle.

LongClick

The user long-pressed on the Rectangle. This event will only trigger if Draggable is false.

StartDrag

The user started a drag operation.

StopDrag

The user stopped a drag operation.