-
Notifications
You must be signed in to change notification settings - Fork 3
2017_05_05_ _JGA_Itowns2_archi_and_tech_presentation
-
The provider is used to retrieve data (from external sources ? From the database only ?...) using protocols. In scene mode, it is possible to add protocols. Provider example in Itowns2 : WMS provider. It seems that there is one provider per protocol.
-
APIGlobe.js : File containing API functions related to globe mode. Also contains example of layers creations.
In iTowns2 : Layer.js
- Geometry Layer : Contains the tiles of the globe (geometry + images)
- The sequence diagram goes (refer here for an hopefully clearer explanation)
- Initialization of the data set:
preprocessDataLayer
that is- defined in a provider
- called only once per layer level
- pulls the 3DTiles defined by some URL
- Initialization of the update:
pre-update()
- technically a callback
- called at each step of the Itowns engine (each time the screen must be refreshed)
- at the level of the layer
- update() (technically callback):
* called for each object of the layer (e.g. tiles of the geometry layer) * returns all the objects that must updated (recursively). * It is itowns/src/Core/Mainloop.js that collects those objects (in need of update) and calls update() on the returned objects (until they are all updated).
- Initialization of the data set:
- Layers linked to other layers only have one "callback" function (update())
- Terrain model and orthoimages are directly downloaded from IGN server using a WMTS protocol.
-
It is better to use
let
andconst
than to usevar
to declare variables : "let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope" (More...).Const
works the same as let but declares constants instead of variables (More on const...) -
Promise is used for asynchronous computations. Used for communication by the provider of Itowns2. For each promise, a function resolve() and reject() is defined. When a promise is "resolved" or "rejected", we can call functions using promise.then() and having has arguments the results of resolve() or reject().