<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>控件</title>
<link type="text/css" rel="stylesheet" href="control_files/contentStyle.css">
<script type="text/javascript" src="control_files/allscript.htm"></script>
<link type="text/css" rel="stylesheet" href="control_files/shCore.css">
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '../../../swf/clipboard.swf';
SyntaxHighlighter.all();
</script>
</head>
<body>
<h1>控件</h1>
<p> </p>
<h1>OpenLayers.Control</h1>
<h2>描述</h2>
<p>控件能影响地图的显示和操作。他们支持所有涉及平移和按比例尺缩放的操作,缺省控件被添加到所在的地图 ,通过传入div到参数项添加一个控件到一个外部的div</p>
<h2>属性</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">属性项</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">含义</p></th>
</tr>
<tr>
<td><p>eventListeners</p></td>
<td><p>OpenLayers.Events</p></td>
<td><p>事件监听者</p></td>
</tr>
</tbody></table>
<h2>构造方法</h2>
<p>OpenLayers.Control</p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p>函数声明</p></th>
<td><p>OpenLayers.Control(options)</p></td>
</tr>
<tr>
<th><p>参数</p></th>
<td><p>options-类型:Object,可选的对象</p></td>
</tr>
<tr>
<th><p>描述</p></th>
<td><p>初始化控件,这个可选的对象可以通过作为一个参数直接扩展控件</p></td>
</tr>
<tr>
<th><p>返回值</p></th>
<td><p>无</p></td>
</tr>
</tbody></table>
<h2>方法</h2>
<p>无</p>
<h2>常量</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">常量名</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">描述</p></th>
<th><p align="center">域值说明</p></th>
</tr>
<tr>
<td><p>EVENT_TYPES</p></td>
<td><p>Array(String)</p></td>
<td><p>描述为支持的应用程序事件类型</p></td>
<td><p>Activate:当激活控件时触发事件</p>
<p>Deactivate:当钝化控件时触发事件</p></td>
</tr>
</tbody></table>
<p> </p>
<h1>OpenLayers.Control.Attribution</h1>
<h2>描述</h2>
<p>从图层添加属性到地图显示。继承自OpenLayers.Control</p>
<h2>属性</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">属性项</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">含义</p></th>
</tr>
<tr>
<td><p>seperator</p></td>
<td><p>String</p></td>
<td><p>分离图层的字符串</p></td>
</tr>
</tbody></table>
<h2>构造方法</h2>
<p>OpenLayers.Control.Attribution</p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p>函数声明</p></th>
<td><p>OpenLayers.Control.Attribution(options)</p></td>
</tr>
<tr>
<th><p>参数</p></th>
<td><p>options-类型:Object,可选的控件对象</p></td>
</tr>
<tr>
<th><p>描述</p></th>
<td><p>初始化一些对图层属性的控件</p></td>
</tr>
<tr>
<th><p>返回值</p></th>
<td><p>无</p></td>
</tr>
</tbody></table>
<h2>方法</h2>
<p>无</p>
<h2>常量</h2>
<p>无</p>
<p> </p>
<h1>OpenLayers.Control.Button</h1>
<h2>描述</h2>
<p>一个简单的用于OpenLayers.Control.Panel.按钮控件,点击会执行trigger()函数。继承自OpenLayers.Control</p>
<h2>属性</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">属性项</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">含义</p></th>
</tr>
<tr>
<td><p>type</p></td>
<td><p>Integer</p></td>
<td><p>按钮类型</p></td>
</tr>
</tbody></table>
<h2>构造方法</h2>
<p>无</p>
<h2>方法</h2>
<p>无</p>
<h2>常量</h2>
<p>无</p>
<p> </p>
<h1>OpenLayers.Control.DragFeature</h1>
<h2>描述</h2>
<p>拖动中移动一个要素,用OpenLayers.Control.DragFeature构造器创建一个新的control.继承自OpenLayers.Control</p>
<h2>属性</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">属性项</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">含义</p></th>
</tr>
<tr>
<td><p>geometryTypes</p></td>
<td><p>Array(String)</p></td>
<td><p>为限制一组图形的拖曳,传递一个匹配geometry类名的字符串序列</p></td>
</tr>
<tr>
<td><p>onStart</p></td>
<td><p>Function</p></td>
<td><p>定义拖曳开始</p></td>
</tr>
<tr>
<td><p>onDrag</p></td>
<td><p>Function</p></td>
<td><p>如果你想知道一个要素每次移动的情况就定义此函数</p></td>
</tr>
<tr>
<td><p>onComplete</p></td>
<td><p>Function</p></td>
<td><p>如果你想知道一个要素完成拖动的时间,就定义此函数</p></td>
</tr>
</tbody></table>
<h2>构造方法</h2>
<p>OpenLayers.Control.DragFeature </p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p>函数声明</p></th>
<td><p>OpenLayers.Control.DragFeature (layer, options)</p></td>
</tr>
<tr>
<th><p>参数</p></th>
<td><p>layer-类型:OpenLayers.Layer.Vector,将要被拖动的含有要素的图层</p>
<p>options-类型:Object,可选的对象,其属性将在控件中设置</p></td>
</tr>
<tr>
<th><p>描述</p></th>
<td><p>创建一个新的控件拖动要素</p></td>
</tr>
<tr>
<th><p>返回值</p></th>
<td><p>无</p></td>
</tr>
</tbody></table>
<p>无</p>
<h2>方法</h2>
<p>无</p>
<h2>常量</h2>
<p>无</p>
<p> </p>
<h1>OpenLayers.Control.DragPan</h1>
<h2>描述</h2>
<p>继承于OpenLayers.Control</p>
<h2>属性</h2>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p align="center">属性项</p></th>
<th><p align="center">类型</p></th>
<th><p align="center">含义</p></th>
</tr>
<tr>
<td><p>type</p></td>
<td><p>OpenLayers.Control.TYPES</p></td>
<td><p>控件类型</p></td>
</tr>
<tr>
<td><p>panned</p></td>
<td><p>Boolean</p></td>
<td><p>地图是否移动。</p></td>
</tr>
<tr>
<td><p>interval</p></td>
<td><p>Integer</p></td>
<td><p>再次漫游地图前的毫秒数。默认为25毫秒。</p></td>
</tr>
</tbody></table>
<h2>构造方法</h2>
<p>无</p>
<h2>方法</h2>
<p>draw </p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p>函数声明</p></th>
<td><p>draw: function()</p></td>
</tr>
<tr>
<th><p>参数</p></th>
<td><p>无</p></td>
</tr>
<tr>
<th><p>描述</p></th>
<td><p>创建一个新的控件,拖动要素,创建一个使用平移地图和平移地图操作完成作为回调的拖拉事件句柄</p></td>
</tr>
<tr>
<th><p>返回值</p></th>
<td><p>无</p></td>
</tr>
</tbody></table>
<p>panMap </p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<th><p>函数声明</p></th>
<td><p>panMap: function(xy)</p></td>
</tr>
<tr>
<th><p>参数</p></th>
<td><p>xy-类型�
评论5