- Mastering OpenLayers 3
- Gábor Farkas
- 327字
- 2021-07-16 09:33:50
Before getting started
Before moving on and customizing the default appearance, we should talk about its rendering process. OpenLayers 3 is a canvas-based web mapping library, which means that it draws everything it can on a single canvas
element. This not only makes the rendering process faster, but also prevents direct styling with CSS. However, there are some parts rendered as pure DOM elements. These parts, specifically the controls, overlays, and drag boxes, can be styled directly. For the other parts, like vector data, the capabilities of the canvas
element can be used for styling, mostly with inner methods. We will discuss rendering in a later chapter in more detail. For now, keeping this nature of the library in mind should be enough.
Tip
Using the DOM renderer opens up new possibilities in CSS styling. However, it cannot render vector data in SVG format; therefore, you can only style image layers directly. The library also loses performance; thus, using the DOM renderer should be considered as a generally bad practice. Renderers in OpenLayers 3 will be discussed in more detail in Chapter 7, Mastering the Renderers.
Basic considerations
From now on, step by step, we will make a simple WebGIS application with OpenLayers 3. In most of the chapters, we will extend the code created in the previous one. To make it clear, we will consider the current goal at the beginning of every chapter.
In this chapter, after a few warm-up examples, we will make the layout of our application. We will make a highly adaptable full-screen application; therefore, we will use relative units whenever it is possible. We will also make sure that our design does not prevent the usage of the default one. For now, the application will have three parts. The map canvas will display the map, the toolbar will contain the control buttons (the tools), and the notification bar will inform the user about the state of our application in various ways.
- 現(xiàn)代C++編程:從入門到實(shí)踐
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- HBase從入門到實(shí)戰(zhàn)
- Getting Started with CreateJS
- Java持續(xù)交付
- Magento 1.8 Development Cookbook
- Java項(xiàng)目實(shí)戰(zhàn)精編
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲案例實(shí)戰(zhàn)全流程詳解(入門與提高篇)
- 數(shù)據(jù)結(jié)構(gòu)案例教程(C/C++版)
- 現(xiàn)代C++編程實(shí)戰(zhàn):132個(gè)核心技巧示例(原書第2版)
- Django 5企業(yè)級(jí)Web應(yīng)用開發(fā)實(shí)戰(zhàn)(視頻教學(xué)版)
- Xamarin Blueprints
- Learning iOS Security
- 跟戴銘學(xué)iOS編程:理順核心知識(shí)點(diǎn)
- Scrapy網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)