The view is the Lightspeed component that handles the positioning and visualization of your data, although it does not contain the data itself. The data is kept in the models, which in turn are added to the layers. The view takes care of:

  • Translation of world to screen: in the view you set the world reference, to which all the layers in the view are mapped. The view’s camera component takes care of the transformation of world coordinates to view coordinates, and the other way around, so that objects can be correctly positioned and moved on the screen. The camera represents the user’s view point on the application. You can use the camera to change the orientation of the view point.

  • Layer management: the view manages layer painting order, allows you to add layers from layer factories and track activity in a layer. It also lets you set up listeners for changes in the layer models. To read more about layers, see Working with layers in a Lightspeed view.

  • Resource management: memory, threading, and so on.

  • Controller management. To learn more about controllers, see Interacting with the view.

  • Background color: you can define which color the view uses to clear the view’s background.