Feature collection

  • Description

      Feature collection

      The Feature Collection component groups one or more map entities together. Any event that occurs within a feature in the collection will also activate the corresponding event in the component of compilation. The Feature Collection component can be loaded from external resources for fill in the maps with content. The only form admitted at the moment is GeoJSON.

  • Events

    • Feature click
    • Event that is executed when a feature is clicked, the feature collection that contains it (if it exists) will also receive the event 'When clicking on a feature'. The function parameter indicates in what secondary function was clicked.
    • Feature drag
    • Event that is executed when a feature is dragged, the main collection will also receive an event 'Feature drag'. The feature parameter indicates which secondary feature was dragged.
    • Feature long click
    • Event that is executed when a long click is made on a feature, the main collection will also receive an event 'By clicking long on a feature'. The feature parameter indicates in which secondary function was clicked for a long time.
    • Feature start drag
    • Event that the user runs begins to drag a feature, the main collection will also receive a 'Start drag' event. The feature parameter indicates which secondary feature was dragged.
    • Feature stop drag
    • Event that is executed when the user stops dragging a feature, the main collection will also receive a 'Finish drag' event. The feature parameter indicates which secondary feature was dragged.
    • Got features
    • Event that is executed when a feature collection is read successfully given a url. The parameter 'features' will be a list of feature descriptions that can be converted into components using the 'Feature from description' procedure.
    • Load error
    • Event that is executed when a error when processing a feature collection document when processing the given url. The parameter 'responseCode' (responseCode) will contain an HTTP status code and the parameter 'errorMessage' it will contain a detailed error message.
  • Procedures

    • Feature from description
    • This method returns a new component based on the description provided. If there is an error in the properties, such as incorrectly formatted data, the method will return the text that describes the error. Use the block is a string? to test if the result is an error message.
      Whether it is an error or not the properties of the features, they become properties of App Inventor using the following insensitive assignment to uppercase and lowercase:
      • Description → Description
      • Draggable → Draggable
      • Infobox → EnableInfobox
      • Fill → FillColor
      • Image → ImageAsset
      • Stroke → StrokeColor
      • Stroke-width → StrokeWidth
      • Title → Title
      • Visible → Visible
    • Load from URL
    • This method allows you to load a GeoJSON description of a collection of features from a URL (including the URLs of the files).
  • Properties

    • Festures (list)
    • Returns a list of features present in the collection of features, if applicable.
    • Features from GeoJSON (text)
    • Fill in the feature collection of a string that contains GeoJSON content. Given the size of such strings, it is recommended to load the collection of features of the assets or the web using the property 'Origin'.
    • Origin (text)
    • It allows you to obtain or modify the origin of the content for the collection of features, such as filename or a URL.
    • Visible (boolean)
    • 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.
    • Height
    • Set the height in pixels.
    • Height in percentage
    • Set the height as a percentage.
    • Width
    • Set the width in pixels.
    • Width in percentage
    • Set the width as a percentage.