|
板凳
楼主 |
发表于 2016-2-4 13:33:13
|
只看该作者
经测试不行,只能通过marker
我最后这么解决的
- //创建虚拟marker
- var vmarker = new AMap.Marker({
- content:' ',
- map:map
- });
- vmarker.on('mouseover',function(e){
- infoWindow.setContent(vmarker.getExtData());
- infoWindow.open(map, vmarker.getPosition());
- }).on('mouseout',function(e){
- infoWindow.close();
- });
- //麻点初始化
- var api_mass = new AMap.MassMarks(api_coordData, {
- url: ctx+'static/img/map/bullet_blue.png',
- anchor: new AMap.Pixel(0,0),
- size: new AMap.Size(15, 15),
- opacity:1,
- zIndex:20,
- cursor:'pointer'
- });
-
- //绑定事件
- api_mass.on('mouseover',function(e){
- vmarker.setExtData(getCoordInfo(e.data));
- vmarker.setPosition(e.data.lnglat);
- AMap.event.trigger(vmarker, "mouseover", {});
- }).on('mouseout',function(e){
- AMap.event.trigger(vmarker, "mouseout", {});
- });
- api_mass.setMap(map);
复制代码
|
|