$(function () { var map = new bmapgl.map('container'); var point = new bmapgl.point(114.617171,35.191209); var zoomctrl = new bmapgl.zoomcontrol(); // 添加缩放控件 map.addcontrol(zoomctrl); map.centerandzoom(point, 17); map.enablescrollwheelzoom(); //启用滚轮放大缩小 map.disablescrollwheelzoom(); map.setmapstylev2({ styleid: '9bdd91603bb6d6cc63218357276fb78f' }); var myicon = new bmapgl.icon("/static/index/img/concatusmap.png", new bmapgl.size(36, 46)); var marker1 = new bmapgl.marker(new bmapgl.point(114.617171,35.191209), { icon: myicon }); function complexcustomoverlay(point, text, mouseovertext) { this._point = point; this._text = text; this._overtext = mouseovertext; } complexcustomoverlay.prototype = new bmapgl.overlay(); complexcustomoverlay.prototype.initialize = function (map) { this._map = map; var div = this._div = document.createelement("div"); div.style.position = "absolute"; div.style.zindex = bmapgl.overlay.getzindex(this._point.lat); div.style.top = "0px"; div.style.left = "0px"; var arrow = this._arrow = document.createelement("div"); var em = this._em = document.createelement("em"); em.style.position = "absolute"; em.id = "emanmin01"; var b = this._b = document.createelement("b"); b.style.position = "absolute"; b.id = "banmin01"; em.appendchild(b); div.appendchild(em); div.appendchild(arrow); map.getpanes().labelpane.appendchild(div); return div; } complexcustomoverlay.prototype.draw = function () { var map = this._map; var pixel = map.pointtooverlaypixel(this._point); this._div.style.left = (pixel.x) + "px"; this._div.style.top = (pixel.y) + "px"; } var mycompoverlay01 = new complexcustomoverlay(new bmapgl.point(114.617171,35.191209)); map.addoverlay(mycompoverlay01); map.addoverlay(marker1); window.setinterval(function () { $("#emanmin01,#emanmin02,#emanmin03,#emanmin04").css({ top: "-16px", left: "-40px", width: "80px", height: "80px" }); window.settimeout(function () { $("#emanmin01,#emanmin02,#emanmin03,#emanmin04").css({ top: "0", left: "-25px", width: "50px", height: "50px" }); }, 680); }, 1588); window.setinterval(function () { $("#banmin01,#banmin02,#banmin03,#banmin04").css({ top: "14px", left: "15px", width: "50px", height: "50px" }); window.settimeout(function () { $("#banmin01,#banmin02,#banmin03,#banmin04").css({ top: "12px", left: "12px", width: "25px", height: "25px" }); }, 680); }, 1588); $('.group .online-map').click(function () { map.centerandzoom(new bmapgl.point(114.163397, 22.291208), 17); var target_top = $("#container").offset().top - 150; $("html,body").animate({ scrolltop: target_top }, 1000); }) })