1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
createlcMaker(data,clickHandler,hoverHandler, mouseoutHandler){ var content = '<div class="way_point">' + ' <div class="way_left_t">\n' + ' <div class="bottom_wai_t">' + ' <div class="bottm_nei_t"></div>' + ' </div>' + ' </div>\n' + '<div class="way_point_back"></div>' + '</div>'; var point = new AMap.LngLat(data.longitude, data.latitude); var myIcon = new AMap.Icon({ image:"images/monitor/static/img/way_point.png", size: new AMap.Size(64, 64),// 图标尺寸 // imageSize: new AMap.Size(46, 28),// 图标所用图片大小 }); var marker = new AMap.Marker({ position:point, map: this.map, content:content, offset: new AMap.Pixel(-17, -42),// 相对于基点的偏移位置 extData:{data:data,type:'lcd'},//自定义数据 icon:myIcon, }); marker["layerType"] = '路测点'; if(clickHandler){ marker.on('click', clickHandler); } if(hoverHandler){ marker.on('mouseover', hoverHandler); } if (mouseoutHandler) { marker.on('mouseout', mouseoutHandler); } // this.map.add(marker); return marker; },
|