我正在尝试创建一个类似于http://projects.flowingdata.com/walmart/的增长地图。
我正在使用https://github.com/marioestrada/jQuery-gMap进行地图绘制。
到目前为止,我已经得到了一个按钮,当我点击它时,我希望开始动画。 点击事件的代码如下:
<script>
$("input.buttonB").click(function(){
window.setTimeout(function() {
$('#map_canvas').gMap('addMarker', {
latitude: 41.60252,
longitude: -100.32855,
content: 'Some HTML content'
}
);
}, 2000);
window.setTimeout(function() {
$('#map_canvas').gMap('addMarker', {
latitude: 11.60252,
longitude: -110.32855,
content: 'Some HTML content'
}
);
}, 2000);
});
</script>
问题是,标记不会每隔两秒钟就出现在屏幕上。该窗口将等待4秒钟,然后同时显示它们。您有什么建议吗?