- Mastering OpenLayers 3
- Gábor Farkas
- 290字
- 2021-07-16 09:33:48
Structure of OpenLayers 3
OpenLayers 3 is a well structured, modular, and complex library, where flexibility and consistency take higher priority than performance. However, this does not mean OpenLayers 3 is slow. On the contrary, the library highly outperforms its predecessor; therefore its comfortable and logical design does not really adversely affect its performance. The relationship of some of the most essential parts of the library can be described with a radial Universal Modeling Language (UML) diagram, such as the following:

Note
Reading a UML scheme can seem difficult, and can be difficult if it is a proper one. However, this simplified scheme is quite easy to understand. With regard to the arrows, 1
represents a one-to-one relation, while the 0..n
and 1
symbols denote a one-to-many relationship.
You will probably never get into direct contact with the two superclasses at the top of the OpenLayers 3 hierarchy: ol.Observable
, and ol.Object
. However, most of the classes you actively use are children of these classes. You can always count on their methods when you design a web mapping or WebGIS application.
In the diagram, we can see that the parent of the most essential objects is the ol.Observable
class. This superclass ensures all of its children have consistent listener methods. For example, every descendant of this superclass bears the on
, once
, and un
functions, making registering event listeners to them as easy as possible.
The next superclass, ol.Object
, extends its parent with methods capable of easy property management. Every inner property managed by its methods (get
, set
, and unset
) are observable. There are also convenience methods for bulk setting and getting properties, called getProperties
and setProperties
. Most of the other frequently used classes are direct, or indirect, descendants of this superclass.
- 精通JavaScript+jQuery:100%動態(tài)網(wǎng)頁設(shè)計密碼
- 零基礎(chǔ)入門學(xué)習(xí)Python
- Linux命令行與shell腳本編程大全(第4版)
- 低代碼平臺開發(fā)實踐:基于React
- OpenCV 4計算機(jī)視覺項目實戰(zhàn)(原書第2版)
- Flink技術(shù)內(nèi)幕:架構(gòu)設(shè)計與實現(xiàn)原理
- Backbone.js Testing
- 從零開始學(xué)UI:概念解析、實戰(zhàn)提高、突破規(guī)則
- Python編程基礎(chǔ)教程
- 金融商業(yè)數(shù)據(jù)分析:基于Python和SAS
- 軟件自動化測試實戰(zhàn)解析:基于Python3編程語言
- Java Web程序開發(fā)參考手冊
- 算法學(xué)習(xí)與應(yīng)用從入門到精通
- 面向?qū)ο蟪绦蛟O(shè)計教程(C#版)
- 你也能看得懂的Python算法書