简体   繁体   中英

how to add paths as parameters in jvectormap?

I hope you can help me, it seems very simple but as I can pass paths as parameters using jvectormaps, something like that

            $('#worldMap').vectorMap({
            map: 'world_mill_en',
            backgroundColor: "transparent",
            zoomOnScroll: false,
            regionStyle: {
                initial: {
                    fill: '#e4e4e4',
                    "fill-opacity": 0.9,
                    stroke: 'none',
                    "stroke-width": 0,
                    "stroke-opacity": 0
                }
            },

            series: {
                regions: [{
                    values: mapData,
                    scale: ["#AAAAAA","#444444"],
                    normalizeFunction: 'polynomial'
                }]
            },
            "paths": {
                "AU": {
                    "path": "M512.3,195.4c2.4-2,14.3-10.8,28.2-5.7c0.4,0.1,0.7,0.4,1,0.7c0.6,0.8,1.5,2.7,0.7,5.6c0,0-0.2,2.2-0.9,3.8   c-0.3,0.7-0.2,1.5,0.2,2.1c1.2,1.6,3.1,4.6,2.6,6.9c-0.1,0.3-0.2,0.5-0.4,0.8c-1.4,1.7-8,8.6-24.6,5.9c-0.4-0.1-0.8-0.3-1.1-0.5   c-0.7-0.7-1.8-2.2-2-4.7c0-0.5-0.2-0.9-0.5-1.3c-1.5-1.8-5.7-7.3-3.9-12.7C511.8,196,512,195.7,512.3,195.4z",
                    "name": "hola"
                },
                "BE": {
                    "path": "M506.2,167.5c0,0,13.5-11,27.3-6c0,0,5.7-0.1,1.6,11c-0.1,0.3-0.1,0.7,0.2,0.9c1.4,1.6,6.4,7.6,0.8,10.4   c0,0-9.5,7.3-23.2,3.9c0,0-3.1-2.2-2.7-5.7c0-0.4-0.1-0.7-0.3-1C508.4,179.5,503.4,173.7,506.2,167.5z",
                    "name": "Belgium"
                }
            }
        });

how do I add "paths" so that the plugin takes it as parameter Thanks for the help.

you can take a look at my fork of jvectormap: https://github.com/fdominik/jvectormap , this one has the drawing of lines into the map.

You can see the usage here: http://sevenhillsaway.com/map/

If you would be able to help with developing it further (eg adding bezier curves ...), I can make you a contributor.

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