百度地图 控件无效,为什么

it2023-05-09  74

var content = '<div style="margin:0;line-height:20px;padding:2px;">' + '地址:港澳工业开发区' + '</div>' //创建检索信息窗口对象 var searchInfoWindow = null searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, { title: '港澳工业开发区', //标题 width: 290, //宽度 height: 30, //高度 panel: 'panel', //检索结果面板 enableAutoPan: true, //自动平移 searchTypes: [ BMAPLIB_TAB_SEARCH, //周边检索 BMAPLIB_TAB_TO_HERE, //到这里去 BMAPLIB_TAB_FROM_HERE, //从这里出发 ], }) marker.enableDragging() //marker可拖拽 searchInfoWindow.open(marker) marker.addEventListener('click', function (e) { searchInfoWindow.open(marker) }) map.addOverlay(marker) //在地图中添加marker
最新回复(0)