简体   繁体   中英

Can't render region labels with Jvectormap

I try to follow this simple example where labels are rendered into the regions of the map. http://jvectormap.com/examples/region-labels/

I boiled my code down to a small fiddlehttp://jsfiddle.net/V8dyd/189/, but I cannot see what I'm doing wrong.

http://jsfiddle.net/V8dyd/188/

$(function()
{
    var map = $('#map')
        .vectorMap(
        {
            map: 'us_aea_en',
            regionLabelStyle:
            {
                initial:
                {
                    fill: '#B90E32'
                },
                hover:
                {
                    fill: 'black'
                }
            },
            labels:
            {
                regions:
                {
                    render: function (code)
                    {
                        return "label";
                    }
                }
            }
        });
});

You are using an old version of jVectorMap. Region static labels are supported starting version 2.0. Here is an updated fiddle .

jquery-jvectormap-2.0.1.min.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM