没有合适的资源?快使用搜索试试~ 我知道了~
OpenLayers地图重点属性摘录
需积分: 10 2 下载量 83 浏览量
2012-05-22
16:30:58
上传
评论
收藏 147KB DOC 举报
温馨提示
![preview](https://dl-preview.csdnimg.cn/4320961/0001-c259fcf44d17208e0c660ebc5da9d340_thumbnail.jpeg)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
试读
15页
学习openlayers的很好的文档 对很多东西都有解释
资源详情
资源评论
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/4320961/bg1.jpg)
一:OpenLayers
1.OpenLayers:常量 version_number 标识版本
二:BaseTypes
2.BaseTypes ( 基 本 类 型 ) : 这 里 定 制 了 Openlayers 中 用 到 的
string、number、function、array
3.Bounds(边界):
属性 left、bottom、right、top、centerLonLat
方法 extend 用于扩展边界,toBBox 用于绑定
4.LonLat(经纬度):
属性 lon 经度、lat 纬度
注意:如果地图不是地理投影,那么调用的 LonLat 表示的是地图上的 x、y 轴坐标,为
(0,0)表示坐标轴原点
例子:map.setCenter(new OpenLayers.LonLat(116.3876,39.8983),13);
最后一个参数表示 Zoom:放大倍数
5.Pixel(像素):属性 x、y 表示 x 和 y 坐标
6.Size:属性 w、h 表示宽和高
三:Console
7.Console:用于调试和把错误等输出到“控制台”上,需要结合使用 firebug
四:Control
8.Control(控件):
使用方法:
方法一:
!!"#$%&'(
)$)$*+
方法二:
!!
"#$%&)$*+,
)$,-.-'
![](https://csdnimg.cn/release/download_crawler_static/4320961/bg2.jpg)
(
9.Button(按钮):方法 trigger() 点击按钮的时候会调用
使用方法:)$"
//-$)$%0 0-..%1#-
(
$)$&'
10. DragPan(鼠标拖动地图)
11. DrawFeature(在矢量图上画点、线、面)
var lines = new OpenLayers.Layer.Vector("Lines", {
styleMap: new OpenLayers.StyleMap({
pointRadius: 3,
strokeColor: "#ff3300",
strokeWidth: 3,
fillOpacity: 0
})
});
var panel = new OpenLayers.Control.Panel({
displayClass: "olControlEditingToolbar"
});
var draw = new OpenLayers.Control.DrawFeature(
lines, OpenLayers.Handler.Path,
{displayClass: "olControlDrawFeaturePath", title: "Draw Lines"}
);
panel.addControls([
new OpenLayers.Control.Navigation({title: "Navigate"}),
draw
]);
map.addControl(panel);
12. EditingToolbar(编辑工具条)
EditingToolbar 包含 4 个控件:draw point、draw lines、draw polygon、pan navigation
构造函数 参数:layer(Openlayer.Layer.Vector)、options
例子:
var vector = new OpenLayers.Layer.Vector("Editable Vectors");
map.addLayers([vector]);
map.addControl(new OpenLayers.Control.EditingToolbar(vector));
13. Geolocate(地理定位)把 w3c geolocation API 包装成控件,与地图绑定,位置发
生变化时触发事件
14. GetFeature
15. Graticule(格子线)在地图上以 grid 显示经纬线
![](https://csdnimg.cn/release/download_crawler_static/4320961/bg3.jpg)
16. KeyboardDefaults:增加了用键盘实现平移缩放功能
m
ap.addControl(new OpenLayers.Control.KeyboardDefaults());
17. LayerSwitcher(图层切换功能)
map.addControl(new OpenLayers.Control.LayerSwitcher());
18. Measure(用于测量绘图):方法 getArea 和 getLength
19. MousePosition(鼠标位置):显示鼠标指针移动时的地理坐标
map.addControl(new OpenLayers.Control.MousePosition());
20. MouseToolbar(鼠标工具栏):有拉框放大的功能,但是需要按住 shift 键,所以
不推荐使用,要实现相同的功能可以使用 NavToolbar
21. Navigation(导航):导航控件处理鼠标事件(拖动、双击、滚动)的地图浏览
注意:这个控件是默认添加到地图中的
22. NavToolbar:加入了两个 mousedefaults 控件,通过使用 zoomBox 实现拉框放大功能
m
ap.addControl(new OpenLayers.Control.NavToolbar());
23. OverviewMap(鹰眼):默认在地图的右下角
map.addControl(new OpenLayers.Control.OverviewMap());
24. Pan(平移)
25. Panel(面板):Panel 控件是其他控件的容器
Each control in the panel is represented by an icon,即表示添加到面板里面的控件都
是用图像表示的
26. PanZoom ( 平 移 缩 放 ) : 由 OpenLayers.Control.PanPanel 和
OpenLayers.Control.PanPanel 这两个控件组成,具有平移和缩放的功能
图标:
map.addControl(new OpenLayers.Control.PanZoom());
27. PanZoomBar(平移缩放工具栏):
由 OpenLayers.Control.PanPanel 和 OpenLayers.Control.ZoomBar 这两个控件组
成 , 具 有 平 移 和 缩 放 功 能 , 这 控 件 和 PanZoom 的区别见图标
图标:
map.addControl(new OpenLayers.Control.PanZoomBar());
28. $Permalink(永久链接):点击永 久链接将用户返回到当前地图视图
例 子 : map.addControl(new OpenLayers.Control.Permalink());
29. Scale(比例尺):以 1:1 这种比率 样式显示当前地图的比例
例 子 : map.addControl(new OpenLayers.Control.Scale());
30. ScaleLine(比例尺):以线段指标 的样式显示当前地图的比例
例 子 : map.addControl(new OpenLayers.Control.ScaleLine());
31. SelectFeature 通过点击或是悬停选 择给定层上的 Feature
构 造 函 数 参 数 : layer(Openlayers.Layer.Vector)、options
属性:multipleKey
toggleKey
multiple:是否允许同时选择多个图形
clickout:取消功能,当点击图形外的任 何东西,取消对图形的选择
hover:鼠标悬停
例子:
剩余14页未读,继续阅读
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![avatar](https://profile-avatar.csdnimg.cn/b0375d3a5c3c4451822098cca388a555_traveler_tian.jpg!1)
斯盖
- 粉丝: 2
- 资源: 13
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 数据库管理工具:dbeaver-ce-23.3.1-stable.x86-64.rpm
- AndroidOCR源码.zip
- 数据库管理工具:dbeaver-ce-23.3.0-x86-64-setup.exe
- 数据库管理工具:dbeaver-ce-23.3.0-stable.x86-64.rpm
- 数据库管理工具:dbeaver-ce-23.3.0-macos-x86-64.dmg
- 数据库管理工具:dbeaver-ce-23.3.0-macos-aarch64.dmg
- 数据库管理工具:dbeaver-ce-23.2.5-stable.x86-64.rpm
- 数据库管理工具:dbeaver-ce-23.2.5-macos-x86-64.dmg
- C语言面试应用详解教程
- 数据库管理工具:dbeaver-ce-23.2.5-macos-aarch64.dmg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)
评论0