OpenLayers持续学习(1)
2018-06-26 本文已影响20人
西兰花伟大炮
(1)创建一幅基础地图
实例化一个map构造函数,基础配置有target, view, layer

(2)添加投影

(3)overlay
Overlays are visible widgets. Unlike Controls, they are not in a fixed position on the screen, but are tied to a geographical coordinate, so panning the map will move an Overlay but not a Control
(4)ol.interaction
- ol.interaction.Snap
当绘制的时候鼠标进入到一个已经绘制好的点的一定容差范围,鼠标点会被吸附到那个已经绘制好的点的位置
(5)
说明控件的折叠
controls: ol.control.defaults({attributionOptions{collapsed:false}})
.extend([newol.supermap.control.Logo()])
false为显示
(6)添加控件的方式
- 初始化地图时通过配置对象添加
- 通过实例化map类后调用方法传参

(7)添加鹰眼控件
- 添加控件需要在添加控件后再加载图层
- 鹰眼控件需要指定投影

(8)

(9)widgets
通知组件,用于进行alert与loading