谷歌地图API - 这条线的含义/功能是什么
Google Maps API - what is the meaning/function of this line?
我正在向我的谷歌地图添加一个搜索框。从文档 (https://developers.google.com/maps/documentation/javascript/examples/places-searchbox):
// Create the search box and link it to the UI element.
var input = document.getElementById('pac-input');
var searchBox = new google.maps.places.SearchBox(input);
map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
我试图确切地了解这在低水平上是如何工作的。最后一行有什么作用?如果它像注释所说的那样将搜索框链接到 UI 元素,它是如何做到这一点的?
如 https://developers.google.com/maps/documentation/javascript/controls#CustomExample 所述
// Add the control to the map at a designated control position
// by pushing it on the position's array. This code will
// implicitly add the control to the DOM, through the Map
// object. You should not attach the control manually.
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv);
相关文章:
- 这是什么 ==- javascript 运算符
- 我的单元测试选项是什么
- 这个jquery语法的功能是什么
- 这里的“shiftBind”功能是什么意思
- 制作预制响应功能的最佳方法是什么
- 谷歌地图API - 这条线的含义/功能是什么
- 在浏览器环境之外充分实现WebGL兼容性所需的最小功能是什么?
- 是什么让这两个功能分别是“公共”和“私有”,这意味着什么?
- Chrome/Firefox中双美元符号选择器查询功能的来源是什么
- 我的功能无法重启的原因是什么?
- React无状态功能组件的流返回类型是什么?
- 在我的网站上做投票功能的最好方法是什么?(现在使用innerhtml
- 在JavaScript中向数字添加标志而不影响其功能的最简单方法是什么?
- 通过这两种不同的方法调用jQuery功能的优缺点是什么
- 如果被窗口打开,新窗口的属性是什么?打开功能
- 开发3D交互图像功能的方向是什么?
- JQuery警报的属性/功能是什么
- 转义 Javascript 序列的最简单方法是什么,如果嵌入到 HTML 代码的脚本标签中,会导致不需要的功能
- 支持iOS、Android、WP8和下拉刷新功能的isroll替代品是什么?
- 这个柜台的功能是什么?雄辩的JavaScript 4.4深度比较的例子