【发布时间】:2019-01-10 00:59:13
【问题描述】:
是否可以向 HERE Map Image API 添加 UI 控件(例如,缩放/导航和弹出链接)?我在Maps API 上找到了它,但我正在尝试查看是否可以将UI 添加到Map Image。
UI 控件未列在主要功能中,但我想我还是会问。有没有人想出如何将 UI 控件添加到地图图像?
【问题讨论】:
标签: user-interface navigation here-api
是否可以向 HERE Map Image API 添加 UI 控件(例如,缩放/导航和弹出链接)?我在Maps API 上找到了它,但我正在尝试查看是否可以将UI 添加到Map Image。
UI 控件未列在主要功能中,但我想我还是会问。有没有人想出如何将 UI 控件添加到地图图像?
【问题讨论】:
标签: user-interface navigation here-api
Map Image API 用于生成静态图像,例如存储在数据库中或通过电子邮件发送。 将缩放/平移图形生成到图像中似乎没有多大意义。
如果您想在图像顶部显示可操作的项目(例如按钮),请使用 div 和 CSS:然后您可以将带有按钮的 div 与图像叠加在 div 的顶部
例如添加一个按钮隐藏:
#container {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
z-index:0
}
#hide {
position: absolute;
top: 10px;
left: 10px;
z-index:2
}
然后:
<div id="container">
<div id="hide"> <button type="button" onclick="hide();">Hide</button></div>
<div id='map'></div>
</div>
【讨论】: