From 1bd975bc23595a25f45d795a1d9da3b6c1f80401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 5 Jul 2012 11:51:05 +0200 Subject: [PATCH] add design assertions to the doc/ol3.txt doc --- doc/ol3.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/ol3.txt b/doc/ol3.txt index 89a7a7f9d4..d903271750 100644 --- a/doc/ol3.txt +++ b/doc/ol3.txt @@ -205,3 +205,42 @@ Question: who determines "best" resolution? (static function?) Todo: if tile layer extent stored in TileLayer rather than TileGrid then extent will occasionally need to be passed to TileGrid functions for cropping + +DESIGN ASSERTIONS +================= + +- A map has a renderer (the map renderer). +- A map has a camera. +- Multiple maps can share the same camera. +- A map has a layer list. + +- A layer view stores view-related states for a layer. +- View-related states include visibility, opacity, saturation, hue, etc. +- A layer view has a layer. +- Multiple layer views can share the same layer. +- In other words a layer can be viewed in different manners. + +- The map renderer responds to events. +- The map renderer receives events from the camera. +- The map renderer creates layer renderers. + +- A layer can have multiple projections (the supported projections). +- A layer advertizes the projections it supports. +- A layer returns no data if asked data for an unsupported projection. + +- A control may listen to map events. +- A control may listen to camera events. +- A map navigation control acts on the camera. + +- Types can be described in MVC terms. +- Models don't know what rendering means. +- Maps are models. +- Layers are models. +- Layer views are models (sorry!). +- Cameras are models. +- Layer lists are collections. +- Renderers are views. +- Controls are views or controllers or both. +- An attribution control is a view. +- A map navigation control is a controller. +- A zoom slider control is both a view and a controller.