【问题标题】:Getting country names with jVectormap World Map使用 jVectormap World Map 获取国家名称
【发布时间】:2013-11-04 21:57:10
【问题描述】:

我有一个世界 jVectormap 世界地图,我希望在 onclick 方法中运行一个脚本来单击国家/地区。有没有办法返回国家名称而不是国家代码?如果没有,有没有办法将国家代码转换为国家名称,而不是通过长 case / if 语句运行它?

谢谢

【问题讨论】:

    标签: javascript html jvectormap


    【解决方案1】:

    试试这个

    onRegionClick: function (event, code) {
         var map = $('#world-map').vectorMap('get', 'mapObject');
         var name = map.getRegionName(code);
    },
    

    【讨论】:

    • 如何在纯javascript中做到这一点?
    猜你喜欢
    • 1970-01-01
    • 2016-06-11
    • 1970-01-01
    • 2017-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多