Quick Start

A Layout is a full featured and customizable view for Tethys Apps. They are different from Template Gizmos, which are only small snippets of a page of that can be composed to create a full feature view. However, Layouts often use Gizmos behind the scenes. For example, the Map Layout includes a fullscreen map with layer tree and includes advanced features like feature selection, properties popups, and click and plot (Figure 1). In addition, Layouts provide rich JavaScript APIs that allow you to access the internal data and customize the dynamic behavoir of the view.

Figure 1. Example of a Map Layout.

Features

Features of Layouts inlcude:

  • Class-based Views: Layouts are powered by Django Class-based views.
  • Inheritance: Customizing a Layouts us accomplished by creating a subclass of the Layout class.
  • Configure via Properties: Many features of Layouts can be easily turned on or off by setting class properties.
  • Customize Behavior via Hooks: More complex customization is accomplished by overriding special methods called hooks.
  • Easy REST Endpoints: Layouts provide an easy mechanism for creating API endpoints for the view without needing to create new controllers or define new URLs.

Documentation

To learn more about Tethys Layouts and how to use them, see the Layouts API Documentation.