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
  • Features
  • FeaturesFromGeoJSON
  • Source
  • Visible
  • Events
  • FeatureClick(component feature)
  • FeatureDrag(component feature)
  • FeatureLongClick(component feature)
  • FeatureStartDrag(component feature)
  • FeatureStopDrag(component feature)
  • GotFeatures(text url, list features)
  • LoadError(text url, list features)
  • Methods
  • FeatureFromDescription(list description)
  • LoadFromURL(text url)
  1. Components
  2. Reference
  3. Maps

FeatureCollection

A FeatureCollection groups one or more map features together. Any events that occur within a feature in the collection will also trigger the corresponding event in the collection component. FeatureCollections can be loaded from exernal resources to populate Maps with content. GeoJSON is the only format supported at this time.

Properties

Features

Returns a list of features present in the feature collection, if any.

FeaturesFromGeoJSON

Populates the feature collection from a string containing GeoJSON content. Given the size of such strings, it is recommended to load the feature collection from assets or the web using the Source property.

Source

The source of the content for the feature collection, such as a filename or a URL.

Visible

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

Events

FeatureClick(component feature)

When a feature is clicked, the feature collection containing it (if any) will also receive a FeatureClick event. The feature parameter indicates which child feature was clicked.

FeatureDrag(component feature)

When a feature is dragged, the parent collection will also receive a FeatureDrag event. The feature parameter indicates which child feature was dragged.

FeatureLongClick(component feature)

When a feature is long clicked, the parent collection will also receive a FeatureLongClick event. The feature parameter indicates which child feature was long clicked.

FeatureStartDrag(component feature)

When the user begins dragging a feature, the parent collection will also receive a FeatureStartDrag event. The feature parameter indicates which child feature was dragged.

FeatureStopDrag(component feature)

When the user stops dragging a feature, the parent collection will also receive a FeatureStopDrag event. The feature parameter indicates which child feature was dragged.

GotFeatures(text url, list features)

The GotFeatures event is run when when a feature collection is successfully read from the given url. The features parameter will be a list of feature descriptions that can be converted into components using the FeatureFromDescription method.

LoadError(text url, list features)

The LoadError event is run when an error occurs while processing a feature collection document at the given url. The responseCode parameter will contain an HTTP status code and the errorMessage parameter will contain a detailed error message.

Methods

FeatureFromDescription(list description)

Returns a new component based on the description provided. If there is an error in the properties, such as incorrectly formatted data, then the method will return text describing the error. Use the is-text? block to test whether the result is an error message. is an error or not. Properties of features are converted into App Inventor properties using the following case-insensitive mapping:

  • description → Description

  • draggable → Draggable

  • infobox → EnableInfobox

  • fill → FillColor

  • image → ImageAsset

  • stroke → StrokeColor

  • stroke-width → StrokeWidth

  • title → Title

  • visible → Visible

LoadFromURL(text url)

Call this method to load a GeoJSON description of a feature collection from a URL (including file URLs). If successful, the set of features managed by the feature collection will be replaced by the new features and LoadFeatureCollection event will be run. If an error occurs, the ErrorLoadingFeatureCollection event will be run instead.

PreviousCircleNextLineString

Last updated 7 years ago