AppyBuilder
  • AppyBuilder Introduction
  • Release Notes
  • Terms of Service
  • AppyBuilder Editors
    • Design Editor
    • Blocks Editor
    • Components
  • Live Testing
  • Components
    • Reference
      • User Interface
        • Button
        • Checkbox
        • Chronometer
        • DatePicker
        • FloatingButton
        • GalleryViewer
        • GridView
        • Image
        • Label
        • ListPicker
        • ListPickerCustom
        • ListView
        • ListViewCustom
        • Notifier
        • PasswordTextBox
        • ProgressBar
        • RatingBar
        • Slider
        • Spinner
        • Switch
        • TextBox
        • Toggler
        • WebViewer
        • TimePicker
        • LinedTextBox
      • Effects
        • Decoration
        • Sidebar
        • Snackbar
      • Layout
        • Horizontal Arrangement
        • Horizontal Scroll Arrangement
        • Table Arrangement
        • Vertical Arrangement
        • Vertical Scroll Arrangement
      • Drawing and Animation
        • Ball
        • Canvas
        • Image Sprite
      • Maps
        • Circle
        • FeatureCollection
        • LineString
        • Map
        • Marker
        • Polygon
        • Rectangle
      • Media
        • Camcorder
        • Camera
        • ImagePicker
        • Player
        • Sound
        • SoundRecorder
        • SpeechRecognizer
        • TextToSpeech
        • VideoPlayer
        • YandexTranslate
      • Connectivity
        • ActivityStarter
        • BluetoothClient
        • NetworkManager
        • Web
        • WiFiManager
      • LegoMindStorms
        • Ev3ColorSensor
        • Ev3Commands
        • Ev3GyroSensor
        • Ev3Motors
        • Ev3Sound
        • Ev3TouchSensor
        • Ev3UI
        • Ev3UltraSonicSensor
        • NxtDirectCommands
        • NxtDrive
        • NxtLightSensor
        • NxtTouchSensor
        • Ev3ColorSensor
      • Storage
        • Airtable
        • File
        • FirebaseDB
        • FTPManager
        • FusionTableControl
        • TinyDB
        • TinyWebDB
      • Sensors
        • Accelerometersensor
        • BarcodeScanner
        • BatteryManager
        • Clock
        • Gyroscopesensor
        • LightSensor
        • LocationSensor
        • MagneticFieldSensor
        • MemoryInfo
        • NearField
        • OrientationSensor
        • Pedometer
        • ProximitySensor
        • PressureSensor
        • SoundSensor
        • TemperatureSensor
        • ProximitySensor
      • Social
        • ContactPicker
        • EmailPicker
        • PhoneCall
        • PhoneNumberPicker
        • Sharing
        • Texting
        • Twitter
      • Experimental
        • CloudDB
      • Visualization
        • GoogleMap
        • XYChart
      • Advanced
        • KitchenSink
        • OneSignalPush
        • PushNotification
        • SQLite
      • Monetize
        • AdAmazon
        • AdAmazonInterstitial
        • AdMob
        • AdMobInterstitial
        • AdMobRewardedVideo
        • InAppBilling
        • MMediaInterstitial
  • Tutorials
    • Openstreet Map
    • OneSignalPush
    • Creating E-book
    • Basic
      • Simulating Progress Bar
      • Creating Splash Screen
      • Adding Privacy Policy
      • Package Name
      • Beginner - Talk to Me app
      • Beginner Tutorial
    • Animation
      • Animation & Collision Part I
      • Animation & Collision Part II
    • Monetization
      • AdMob Banner
      • AdMob Interstitial
      • AdMob Rewarded Video
      • Increasing Monetization Revenue
    • Using RadioButtons
    • keystore
    • Firebase - Advanced
  • Extensions
  • Concept Cards
    • Bouncing Sprites
    • Sprite Timed Movement
    • Sprite Movement on Timer
    • Adding Sound
    • Speech Recognition
    • Random Numbers
    • Fling Movement
    • Movement with Sensors
    • Drawing on Canvas
    • Multiple Screens
    • Creating Custom Colors
    • Movement with Buttons
    • Shaking Phone
    • Collision Detection
    • Dragging A Sprite
  • Advanced
    • Source File Structure
  • Code Editor
Powered by GitBook
On this page
  • Properties
  • Description
  • Draggable
  • EastLongitude
  • EnableInfobox
  • FillColor
  • NorthLatitude
  • SouthLatitude
  • StrokeColor
  • StrokeWidth
  • Title
  • Type
  • Visible
  • WestLongitude
  • Events
  • Click
  • Drag
  • LongClick
  • StartDrag
  • StopDrag
  • Methods
  • Bounds
  • Center
  • DistanceToFeature(component mapFeature, boolean centroids)
  • DistanceToPoint(number latitude, number longitude, boolean centroids)
  • HideInfobox
  • SetCenter(number latitude, number longitude)
  • ShowInfobox
  1. Components
  2. Reference
  3. Maps

Rectangle

Rectangles are polygons with fixed latitudes and longitudes for the north, south, east, and west boundaries. Moving a vertex of the rectangle updates the appropriate edges accordingly.

Properties

Description

Sets or gets the description displayed in the info window that appears when the user taps on the rectangle.

Draggable

Sets or gets whether or not the user can drag a map feature by long-pressing and then dragging the rectangle to a new location.

EastLongitude

Sets or gets the longitude bounding the rectangle on the east. Range: [-180, 180]

EnableInfobox

Enables or disables the infobox window display when the user taps the rectangle.

FillColor

Sets or gets the color used to fill in the rectangle.

NorthLatitude

Sets or gets the latitude, in degrees, bounding the rectangle on the north. Range: [-90, 90]

SouthLatitude

Sets or gets the latitude, in degrees, bounding the rectangle on the south. Range: [-90, 90]

StrokeColor

Sets or gets the color used to outline the rectangle.

StrokeWidth

Sets or gets the width of the stroke used to outline the rectangle.

Title

Sets or gets the title displayed in the info window that appears when the user clicks on the rectangle.

Type

Gets the type of the feature. For Rectangle, this will always be "Rectangle".

Visible

Sets or gets whether the component should be visible on the screen. Value is true if the component is showing and false if hidden.

WestLongitude

Sets or gets the longitude, in degrees, bouding the rectangle on the west. Range: [-180, 180]

Events

Click

Runs when the user taps on the rectangle.

Drag

Runs continuously while a user is dragging the rectangle.

LongClick

Runs when the user long-clicks on the rectangle but does not trigger a drag. Note that this event will only run if Draggable is false.

StartDrag

Runs before a drag operation begins.

StopDrag

Runs after a drag operation completes.

Methods

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(component mapFeature, boolean centroids)

Computes the distance between the Rectangle and the given mapFeature. If centroids is true, the computation is done between the centroids of the two features. Otherwise, the distance will be computed between the two features based on the closest points. Further, when centroids is false, this method will return 0 if the rectangle intersects or contains the mapFeature. If an error occurs, this method will return -1.

DistanceToPoint(number latitude, number longitude, boolean centroids)

Computes the distance between the Rectangle and the given latitude and longitude. If centroids is true, the distance is computed from the center of the rectangle to the given point. Otherwise, the distance is computed from the closest point on the rectangle to the given point. Further, this method will return 0 if centroids is false and the point is in the rectangle. If an error occurs, -1 will be returned.

HideInfobox

Hides the rectangle's info box if it is visible. Otherwise, this method has no effect.

SetCenter(number latitude, number longitude)

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

Shows the info box for the rectangle if it is not visible. Otherwise, this method has no effect. This method can be used to show the info box even if EnableInfobox is false.

PreviousPolygonNextMedia

Last updated 7 years ago