")), offset: new AMap.Pixel(16, -45)});function createInfoWindow(title, content) { var info = document.createElement("div"); info.className = "custom-info input-card content-window-card"; var top = document.createElement("div"); var titleD = document.createElement("div"); var closeX = document.createElement("img"); top.className = "info-top"; titleD.innerHTML = title; closeX.src = "static/picture/close2.gif"; closeX.onclick = closeInfoWindow; top.appendChild(titleD); top.appendChild(closeX); info.appendChild(top); var middle = document.createElement("div"); middle.className = "info-middle"; middle.style.backgroundColor = 'white'; middle.innerHTML = content; info.appendChild(middle); var bottom = document.createElement("div"); bottom.className = "info-bottom"; bottom.style.position = 'relative'; bottom.style.top = '0px'; bottom.style.margin = '0 auto'; var sharp = document.createElement("img"); sharp.src = "static/picture/sharp.png"; bottom.appendChild(sharp); info.appendChild(bottom); return info;}addMarker();function addMarker() { map.clearMap(); var marker = new AMap.Marker({ map: map, position: [116.913143,39.250961] }); infoWindow.open(map, marker.getPosition()); AMap.event.addListener(marker, 'click', function () { infoWindow.open(map, marker.getPosition()); });}function closeInfoWindow() { map.clearInfoWindow();}