6、使用infowindow
ESRI公司提供的infowindow既美观用实用,而且可定制性强,是时时获取信息的好窗口,用好它可以使工作量大大的减少。
他的使用方法介绍如下:
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. 判断信息窗口的显示状态 |
2、 常量:
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.右上 |
3、 方法:
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. 显示信息框(位置点,位置) |
4、 事件:
onHide() |
隐藏窗口时的事件 |
onShow() |
显示窗口时的事件 |
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); //为获取系统建议的显示位置,这样写可以使窗口尽量显示在屏幕中最佳位置!!
转载于:https://www.cnblogs.com/dwf07223/archive/2013/04/27/3048095.html
6、使用infowindow相关推荐
- android mapbox 添加多个点,使用Android Mapbox SDK显示多个标记的自定义infoWindow
我想要在地图上可视化多个标记.它的完美展示和onMarkerTap从数据库检索的显示信息为JSON.我想要做的是在自定义布局或底部工作表中显示信息.当用户点击标记时,底部表单将出现,并显示与该标记相关 ...
- 百度地图infowindow
2019独角兽企业重金招聘Python工程师标准>>> private void showInfoWindow(LatLng latLng, String address){View ...
- bminfowindow是什么_三步实现地图自定义InfoWindow
前言 现在的app很多都需要接入地图,不同的app都会定义自己的marker以及InforWindow,本文以高德地图为例,描述自己自定义InfoWindow之路. 先看看效果图: 高德地图的SDK以 ...
- 关于百度地图 BMap.InfoWindow 只显示最后一条信息解决方法
转摘:http://blog.csdn.net/guo_love_peng/article/details/8674230 今天遇到这个问题了.后面再网上搜搜,发现都是你抄我,我转载你的,后来无意看到 ...
- Google Map 自定义infowindow
最近做的东西用到了infowindow,不过google提供的样式太难看了,于是想改变一下样式.看了一下好像infowindow的样式不太好改. 查了半天资料,看到一个infobox,感觉真的挺好用. ...
- 百度地图infoWindow圆角处理
最近的一个项目用到了百度地图API里边的infoWindow弹框,但是百度自带的infoWindow弹框是个直角的矩形框,显示过于难看,于是有了将该框改为圆角的想法,但是API本身不支持样式的设置,所 ...
- html的 button点击事件无效,InfoWindow里面加button,监听button点击事件无效 求解啊...
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 点击infoWindw中的button按钮,无效果: 覆盖默认的dom结构 html, body, #container { width: 100%; h ...
- android 百度map 一个layout加载多个mapview,android 百度地图API 使用Marker和InfoWindow
前言:在android开发过程中,百度地图的使用是比较普遍的,但是如何使用,使用什么版本的百度API还是需要一些讲究. 在项目过程中,需要用到百度地图的marker和InfoWindow的功能. 标注 ...
- Arcgis Javascript那些事儿(九)--自定义infowindow
从开始使用js API,就一直使用infowindow,最近需要自定义的时候才发现里面问题和方法还挺多的,没有android端这么清晰,最近看了些博文和官网,自己总结了方法如下: 一.继承infowi ...
最新文章
- 使用opencv训练cascade分类器进行目标检测
- 理解分布式一致性:Raft协议
- 您应该如何改变数据科学教育
- 一句 Task.Result 就死锁, 这代码还怎么写?
- 【开发者成长】喧哗的背后:Serverless 的挑战
- 【工作总结】银行应用系统架构(二)
- 在…视域下是什么意思_电影中出现的出品人是什么意思?你需要了解下
- 泰坦尼克号python数据分析统计服_Titanic数据分析报告(Python)
- 安装autocad2006出错
- 在Ubuntu18.04TLS下安装小米随身wifi驱动
- 微信小程序(三)自定义分享按钮和原生分享区分不同按钮的分享带参数分享和获取
- 当兵的目标和计划_最新大学生征兵工作计划
- LearnOpenGL学习笔记—PBR:IBL
- 中国软件网祝大家破五快乐
- 有限群元素的阶必然存在
- 计算机应用基础评价手册,中职计算机应用基础教案【精选】.doc
- 一切有迹可循!优秀程序员的9个早期迹象
- 神州八号明日清晨发射
- python中0代表什么_python语言中,0.1**0.3表示什么_学小易找答案
- 服务器错误500 501 502 503 504 505 详解