小编Max*_* Ke的帖子

调用jvectormap的addMarker函数

我正在使用jVectorMap插件,我想通过另一个函数触发标记.我该怎么称呼那一行 map.addMarker( index, markers[index], [values1[index], values2[index]] );

$("#target").click(function() {
**Here should that addMarker function included**
});
Run Code Online (Sandbox Code Playgroud)

这是代码的一部分,其中标记由复选框触发:

            $('.list-markers :checkbox').change(function(){

                var index = $(this).closest('li').attr('data-marker-index');

                if ($(this).prop('checked')) {
                    map.addMarker( index, markers[index], [values1[index], values2[index]] );
                } else {
                    map.removeMarkers( [index] );
                }
            });
Run Code Online (Sandbox Code Playgroud)

非常感谢

jquery jvectormap

2
推荐指数
1
解决办法
3765
查看次数

标签 统计

jquery ×1

jvectormap ×1