logo资料库

Gabor Farkas-Mastering OpenLayers 3.pdf

第1页 / 共308页
第2页 / 共308页
第3页 / 共308页
第4页 / 共308页
第5页 / 共308页
第6页 / 共308页
第7页 / 共308页
第8页 / 共308页
资料共308页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
About the Reviewer
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Creating Simple Maps with OpenLayers 3
Before getting started
Creating a working environment
Structure of OpenLayers 3
Building the layout
Creating the appeal
Writing the code
Using the API documentation
Understanding type definitions
Debugging the code
Summary
Chapter 2: Applying Custom Styles
Before getting started
Basic considerations
Customizing the default appearance
Identifying the classes
Styling the controls
Customizing the attribution control
Creating a custom zoom control with CSS
Styling vector layers
Customizing the appearance with JavaScript
Changing the overview map and the scale bar
Truncating the coordinate control
Changing the attribution
Creating a WebGIS client layout
Building the HTML
Styling the layout
Writing the code
Summary
Chapter 3: Working with Layers
Before getting started
Using a proxy
Resources to use
Basic considerations
Building a layer tree
Styling the layer tree
Creating a layer tree constructor
Adding layers dynamically
Creating the interface
Extending the constructor
Fetching the WMS metadata
Adding WMS layers
Adding WFS layers
WFS considerations
Adding vector layers with the File API
Creating the interface
Building the method
Adding vector layers with a library
Removing layers dynamically
Extending a constructor
Changing layer attributes
Styling active layers
Extending the method
Changing the layer order with the Drag and Drop API
Clearing the message bar
Summary
Chapter 4: Using Vector Data
Before getting started
Accessing attributes
Writing the code
Setting attributes
Styling the form
Writing the code
Validating attributes
Adjusting the styles
Building headers
Writing the code
Creating thematic layers
Extending the layer tree
Creating choropleth maps
Creating categorized maps
Saving vector data
Saving in arbitrary formats
Saving with WFS-T
Modifying the geometry
Summary
Chapter 5: Creating Responsive Applications with Interactions and Controls
Before getting started
Basic considerations
Building the toolbar
Mapping interactions to controls
Creating the control
Adding and removing the control
Adding a selection control
Building a set of feature selection controls
Styling the controls
Creating the selection tools
Adding new vector layers
Creating the HTML and the CSS
Extending the layer tree
Building a set of drawing tools
Writing the method
Modifying and snapping to features
Extending the method
Creating new interactions
Understanding ol.interaction.Pointer
Removing features
Dragging features
Extending the method
Building a measuring control
Creating the interaction
Doing geodesic measurements
Calculating lengths even more precisely
Summary
Chapter 6: Controlling the Map – View and Projection
Before getting started
Basic considerations
Customizing a view
Constraining a view
Creating a navigation history
Working with extents
Creating a zoom control
Extending the toolbar
Rotating a view
Changing the map's projection
Creating custom animations
Building the control
Creating animations
Summary
Chapter 7: Mastering Renderers
Before getting started
Using different renderers
Creating a WebGL map
Drawing lines and polygons with WebGL
Blending layers
Clipping layers
Exporting a map
Creating a raster calculator
Raster 101
Operating with pixels
Creating a convolution matrix
How convolution works
Converting an image to 8-bit
Implementing the Sobel filter
Normalizing an image
Finalizing a control
Clipping a layer with WebGL
Writing programs
Creating a clipping mask
Summary
Chapter 8: OpenLayers 3 for Mobile
Before getting started
Basic considerations
Responsive styling with CSS
Writing the style sheet
Constructing the map
Generating geocaches
Adding device-dependent controls
Adding controls for touch devices
Adding controls for desktop computers
Vectorizing the mobile version
Making the mobile application interactive
Summary
Chapter 9: Tools of the Trade: Integrating Third-Party Applications
Before getting started
Exporting a QGIS project
Installing the qgis2web plugin
Inspecting the project
Exporting a map
Salvaging the results
Importing shapefiles
Editing the HTML file
Replacing a function
Spatial analysis with Turf
Preparing an example
Implementing a buffer operation
Implementing a merge operation
Implementing the self-intersect operation
Spatial analysis with JSTS
Implementing operations
3D rendering with Cesium
Preparing a map
Creating a control
Observing a terrain
Extending the Cesium scene
Summary
Chapter 10: Compiling Custom Builds with Closure
Before getting started
Configuring Node JS
Installing Node JS on Windows
Installing Node JS on Linux
Resolving dependencies
Compiling OpenLayers 3
Building default versions
Understanding a configuration file
Building OpenLayers 3 with a subset of features
Bundling an application with OpenLayers 3
Editing the application
Creating a configuration file
Fixing the application
Extending OpenLayers 3
Creating rich documentation with JSDoc
Customizing the documentation
Summary
Index
[ 1 ]
Mastering OpenLayers 3 Create powerful applications with the most robust open source web mapping library using this advanced guide Gábor Farkas BIRMINGHAM - MUMBAI
Mastering OpenLayers 3 Copyright © 2016 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2016 Production reference: 1220116 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78528-100-6 www.packtpub.com
Credits Author Gábor Farkas Reviewer Jose Troche Project Coordinator Bijal Patel Proofreader Safis Editing Commissioning Editor Veena Pagare Indexer Monica Ajmera Mehta Acquisition Editor Sonali Vernekar Graphics Disha Haria Content Development Editor Production Coordinator Anish Dhurat Conidon Miranda Technical Editor Jayesh Sonawane Cover Work Conidon Miranda Copy Editors Sonia Cheema Trishya Hajare
About the Author Gábor Farkas is a PhD student at University of Pécs's Institute of Geography. He holds a master's degree in geography, although he moved from traditional geography to pure Geoinformatics early in his academic journey. He often studies Geoinformatical solutions in his free time, keeps up with the latest trends, and is an open source enthusiast. He loves to work with GRASS GIS, PostGIS, and QGIS, but his all-time favorites are open source web mapping technologies, which mostly cover his main areas of research interest. There have been many kind-hearted and nice people in my life who have helped me in my career or private life by giving me great advice. However, there is one significant person who has made this book possible. I would like to dedicate this book to my advisor, Titusz Bugya, who gave me the tip of starting a blog about WebGIS in English. This blog eventually led to the writing of this book. So, thanks Titusz; this book is partially the result of your trust and effort.
About the Reviewer Jose Troche is a seasoned software development engineer with over a decade of hands-on experience in architecting and building enterprise web applications in multitiered environments. He has developed web-based applications that are capable of creating, storing, searching, retrieving, real-time sharing, and tracking geospatial data. He has also created REST APIs for advanced geospatial web services that are deployed to large-scale enterprise cloud architectures. He has integrated OpenLayers into several of his projects. Jose has also worked as a contractor in aerospace and defense companies and agencies such as NASA, Lockheed Martin and General Dynamics; he is currently employed by Amazon Inc.
www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Table of Contents Preface Chapter 1: Creating Simple Maps with OpenLayers 3 Before getting started Creating a working environment Structure of OpenLayers 3 Building the layout Creating the appeal Writing the code Using the API documentation Understanding type definitions Debugging the code Summary Chapter 2: Applying Custom Styles Before getting started Basic considerations Customizing the default appearance Identifying the classes Styling the controls Customizing the attribution control Creating a custom zoom control with CSS Styling vector layers Customizing the appearance with JavaScript Changing the overview map and the scale bar Truncating the coordinate control Changing the attribution [ i ] vii 1 2 2 3 4 5 6 9 10 11 12 13 13 14 14 15 15 18 19 22 24 24 25 26
分享到:
收藏