ESRI使用infowindow
2017-02-27 14:48
337 查看
ESRI公司提供的infowindow既美观用实用,而且可定制性强,是时时获取信息的好窗口,用好它可以使工作量大大的减少。
他的使用方法介绍如下:
1、 主要属性
2、 常量:
3、 方法:
4、 事件:
5、 使用实例:
function infowindow(evt)
{
map.infoWindow.setTitle("Coordinates");
map.infoWindow.setContent("lat/lon : " + evt.mapPoint.y + ", " + evt.mapPoint.x +
"<br />screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y);
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
}
map.getInfoWindowAnchor(evt.screenPoint):为获取系统建议的显示位置,这样写可以使窗口尽量显示在屏幕中最佳位置!!
他的使用方法介绍如下:
1、 主要属性
Property | Type | Description |
anchor | String | Placement of the InfoWindow with respect to the graphic. See the Constants table for values. Infowindow的显示位置,具体请看其“常量“设置 |
coords | Point | The anchor point of the InfoWindow in screen coordinates. 信息窗口所在的坐标点 |
fixedAnchor | String | InfoWindow always show with the specified anchor. See the Constants table for values. 指定的显示位置 |
isShowing | Boolean | Determines whether the InfoWindow is currently shown on the map. 判断信息窗口的显示状态 |
ANCHOR_LOWERLEFT | 窗口位于点的左下 |
ANCHOR_LOWERRIGHT | InfoWindow is anchored to the lower right of the point. 右下 |
ANCHOR_UPPERLEFT | InfoWindow is anchored to the upper left of the point.左上 |
ANCHOR_UPPERRIGHT | InfoWindow is anchored to the upper right of the point.右上 |
Method | Return Value | Description |
hide() | none | 隐藏信息窗口 |
move(point) | none | Moves the InfoWindow to the specified screen point. 移动信息框到指定点 |
resize(width, height) | none | Resizes the InfoWindow to the specified height and width in pixels.改变信息框大小 |
setContent(stringOrDOMNode) | InfoWindow | Sets the content in the InfoWindow.设置信息窗口的内容 |
setFixedAnchor(anchor) | none | Sets the fixed location of the InfoWindow anchor. Valid values are listed in the Constants table.设置显示位置 Anchor参数为上面的常量类型 |
setTitle(title) | InfoWindow | Sets the title for the InfoWindow. 设置窗口的标题 |
show(point, anchor) | none | Shows the InfoWindow at the specified screen point and anchor. Valid values are listed in the Constants table. 显示信息框(位置点,位置) |
onHide() | 隐藏窗口时的事件 |
onShow() | 显示窗口时的事件 |
function infowindow(evt)
{
map.infoWindow.setTitle("Coordinates");
map.infoWindow.setContent("lat/lon : " + evt.mapPoint.y + ", " + evt.mapPoint.x +
"<br />screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y);
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
}
map.getInfoWindowAnchor(evt.screenPoint):为获取系统建议的显示位置,这样写可以使窗口尽量显示在屏幕中最佳位置!!
相关文章推荐
- SQL2008如何使用空间工具(Spatial Tools)导入ESRI格式地图数据的示例
- 推荐:ESRI用户使用Python指南
- Esri Maps for Office使用揭秘
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
- ArcGIS API for Javascript 使用query查询以某个点为半径的圆内的要素出现“esri.config.defaults.io.proxyUrl 尚未进行设置”错误
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
- 在使用Fragstats4.1软件,添加ESRI Grid图层时出现错误:Error: Grid IO dll is not loaded。
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
- 6、使用infowindow
- Esri Maps for Office使用揭秘
- Esri Maps for Office使用揭秘
- 6、使用infowindow
- 【2012Esri中国用户大会讲座】ArcGIS 10.1 for Server 安全机制(2)使用Token
- SQL Server 2008空间数据应用系列九:使用空间工具(Spatial Tools)导入ESRI格式地图数据
- ESRI.ArcGIS.DataManagementTools.Append 使用
- Esri Maps for Office使用揭秘
- 使用百度地图API的,BMapLib.SearchInfoWindow乱码问题
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用