Jmap jQuery plugin

日本地図 jQuery プラグイン - Released under the MIT license


Jmap jQuery pluginは、情報配信に適したシンプルな形状の日本地図を表示することができます。 出力される地図はHTMLコーダーやCSSデザイナーも気軽に利用できるようHTMLとCSSのシンプルな構造となっており、カスタマイズ性に優れかつ便利な機能を複数備えています。

1 クイックスタート - 最初の一歩

最初の一歩は驚くほど簡単です。

ファイルのダウンロードが完了したらHTMLファイルを作成し、jQueryとJmap jQuery pluginを読み込みましょう。

jQueryとJmapの読み込みコード

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="./jmap.js"></script>
                    

チュートリアル作成時のjQuery最新版は3.4.1です。最新のものを利用したい場合は以下から最新版を取得してください。

Google Hosted Libraries
Example

<html>
<head>
    <title>Jmap jQuery Example</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="./jmap.js"></script>
    <script type = "text/javascript">
        $(document).ready(function() {
            $('#jmap').jmap();
        });
    </script>
</head>
<body>
    <div id="jmap"></div>
</body>
</html>
                    

2 ステップアップ - カスタマイズ

一手間が大きな変化につながります。

Example

$('#jmap').jmap({
    width: '100%',
    height: '450px',
    lineColor: '#EFE4A6',
    lineWidth: 2,
    showTextShadow: true,
    backgroundColor: '#6FCFDD',
    backgroundRadius: '0.5rem',
    backgroundPadding: '0.5rem',
    dividerColor: '#EFE4A6',
    showPrefectureName: true,
    showRoundedPrefecture: true,
    prefectureNameType: 'full',
    prefectureBackgroundColor: '#62B34C',
    prefectureBackgroundHoverColor: '#95A834',
    prefectureLineColor: '#EFE4A6',
    prefectureLineHoverColor: '#ffffff',
    prefectureLineWidth: '2px',
    prefectureLineGap: '0px',
    prefectureInnerLineWidth: '1px',
    prefectureInnerLineColor: '#EFE4A6',
    prefectureInnerLineType: 'outset',
    prefectureRadius: '15px',
    prefectureLineY: '2px',
    prefectureLineX: '2px',
    fontSize: '0.6rem',
    fontColor: '#fff'
});
                    
Example

$('#jmap').jmap({
    viewType: 'grid',    // 地図のグリッド表示
    width: '100%',      // 横幅
    height: '450px',    // 縦幅
    showPrefectureName: true,   // 都道府県名の有無
    prefectureNameType: 'full', // 都道府県名の表示形式
    prefectureBackgroundColor: '#ffcc66',   // 地図の色
    prefectureBackgroundHoverColor: '#ffe0a3',  // 地図ホバー色
});
                    

3 アドバンス - 高度な設定

世界に一つしかない地図を生み出そう。

Example

<html>
<head>
    <title>Jmap jQuery Example</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    <script type="text/javascript" src="./jmap.js"></script>
    <script type = "text/javascript">
        // ここに「Javascript」に記載する内容
    </script>
</head>
<body>
    <!-- Jmap表示位置 -->
    <div id="jmap"
        <div class="jmap-infobox">
            <h5 class="h5">世界に一つだけの地図</h5>
            <p>地図をクリックするとモーダルが表示されます。</p>
        </div>
    ></div>

    <!-- モーダル用HTML -->
    <div class="modal fade" id="prefectureModal" tabindex="-1" role="dialog" aria-labelledby="prefectureModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="prefectureModalTitle"></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body overflow-auto" style="height:350px;">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">閉じる</button>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
                            

$(document).ready(function() {
    $('#jmap').jmap({
        height: '450px',
        lineColor: '#bfbfbf',
        lineWidth: 1,
        showInfobox: true,
        backgroundRadius: '0.3rem',
        backgroundPadding: '1rem',
        backgroundColor: '#ff000000',
        prefectureClass: 'prefecture',
        prefectureLineColor: '#ffffff',
        prefectureLineWidth: 1,
        prefectureLineHoverColor : '#fff',
        fontSize: '0.8rem',
        fontColor: '#000',
        font: 'serif',
        areas: [
        {code : 1, name: "北海道", color: "#7f7eda", hoverColor: "#b3b2ee" },
        {code : 2, name: "青森", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 3, name: "岩手", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 4, name: "宮城", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 5, name: "秋田", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 6, name: "山形", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 7, name: "福島", color: "#759ef4", hoverColor: "#98b9ff" },
        {code : 8, name: "茨城", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 9, name: "栃木", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 10, name: "群馬", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 11, name: "埼玉", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 12, name: "千葉", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 13, name: "東京", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 14, name: "神奈川", color: "#7ecfea", hoverColor: "#b7e5f4" },
        {code : 15, name: "新潟", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 16, name: "富山", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 17, name: "石川", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 18, name: "福井", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 19, name: "山梨", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 20, name: "長野", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 21, name: "岐阜", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 22, name: "静岡", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 23, name: "愛知", color: "#7cdc92", hoverColor: "#aceebb" },
        {code : 24, name: "三重", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 25, name: "滋賀", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 26, name: "京都", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 27, name: "大阪", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 28, name: "兵庫", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 29, name: "奈良", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 30, name: "和歌山", color: "#ffe966", hoverColor: "#fff19c" },
        {code : 31, name: "鳥取", color: "#ffcc66", hoverColor: "#ffe0a3" },
        {code : 32, name: "島根", color: "#ffcc66", hoverColor: "#ffe0a3" },
        {code : 33, name: "岡山", color: "#ffcc66", hoverColor: "#ffe0a3" },
        {code : 34, name: "広島", color: "#ffcc66", hoverColor: "#ffe0a3" },
        {code : 35, name: "山口", color: "#ffcc66", hoverColor: "#ffe0a3" },
        {code : 36, name: "徳島", color: "#fb9466", hoverColor: "#ffbb9c" },
        {code : 37, name: "香川", color: "#fb9466", hoverColor: "#ffbb9c" },
        {code : 38, name: "愛媛", color: "#fb9466", hoverColor: "#ffbb9c" },
        {code : 39, name: "高知", color: "#fb9466", hoverColor: "#ffbb9c" },
        {code : 40, name: "福岡", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 41, name: "佐賀", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 42, name: "長崎", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 43, name: "熊本", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 44, name: "大分", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 45, name: "宮崎", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 46, name: "鹿児島", color: "#ff9999", hoverColor: "#ffbdbd" },
        {code : 47, name: "沖縄", color: "#eb98ff", hoverColor: "#f5c9ff" }
        ],
        onLoad: function(e, data) {
            $(this).html('<strong>' + data.name + '</strong>');
        },
        onSelect: function(e, data) {
            $('#prefectureModal').find('#prefectureModalTitle')
            .html(data.area8.name + " - " + data.area11.name + " - " + data.name + data.full)
            .end().find('.modal-body')
            .html(JSON.stringify(data, null, 4))
            .end().modal('show');
        },
        onHover: function(e, data) {
            console.log(data);
        }
    });
});
                            

この地図では各都道府県別に色を設定し、都道府県を選択するとその都道府県の情報がモーダルで表示されます。

都道府県選択の挙動は、onSelect で指定する事ができます。

世界に一つだけの地図

地図をクリックするとモーダルが表示されます。

4 ビジュアライズ - 高度な設定

見えなかった世界を可視化しよう。

Example

$('#jmap').jmap({
    height: "450px",
    skew: '10',
    showHeatmap: true,
    heatmapLabelUnit: '人',
    heatmapType: 'HRed',
    showHeatlabel: true,
    onSelect: function(e, data) {
        alert('人口は:%d 人です。'.replace('%d', (data.option.number * 1000).toLocaleString());
    },
    areas: [
    {code: 1,name: "北海道",number: 5320},
    {code: 2,name: "青森",number: 1278},
    {code: 3,name: "岩手",number: 1255},
    {code: 4,name: "宮城",number: 2323},
    {code: 5,name: "秋田",number: 996},
    {code: 6,name: "山形",number: 1102},
    {code: 7,name: "福島",number: 1882},
    {code: 8,name: "茨城",number: 2892},
    {code: 9,name: "栃木",number: 1957},
    {code: 10,name: "群馬",number: 1960},
    {code: 11,name: "埼玉",number: 7310},
    {code: 12,name: "千葉",number: 6246},
    {code: 13,name: "東京",number: 13724},
    {code: 14,name: "神奈川",number: 9159},
    {code: 15,name: "新潟",number: 2267},
    {code: 16,name: "富山",number: 1056},
    {code: 17,name: "石川",number: 1147},
    {code: 18,name: "福井",number: 779},
    {code: 19,name: "山梨",number: 823},
    {code: 20,name: "長野",number: 2076},
    {code: 21,name: "岐阜",number: 2008},
    {code: 22,name: "静岡",number: 3675},
    {code: 23,name: "愛知",number: 7525},
    {code: 24,name: "三重",number: 1800},
    {code: 25,name: "滋賀",number: 1413},
    {code: 26,name: "京都",number: 2599},
    {code: 27,name: "大阪",number: 8823},
    {code: 28,name: "兵庫",number: 5503},
    {code: 29,name: "奈良",number: 1348},
    {code: 30,name: "和歌山",number: 945},
    {code: 31,name: "鳥取",number: 565},
    {code: 32,name: "島根",number: 685},
    {code: 33,name: "岡山",number: 1907},
    {code: 34,name: "広島",number: 2829},
    {code: 35,name: "山口",number: 1383},
    {code: 36,name: "徳島",number: 743},
    {code: 37,name: "香川",number: 967},
    {code: 38,name: "愛媛",number: 1364},
    {code: 39,name: "高知",number: 714},
    {code: 40,name: "福岡",number: 5107},
    {code: 41,name: "佐賀",number: 824},
    {code: 42,name: "長崎",number: 1354},
    {code: 43,name: "熊本",number: 1765},
    {code: 44,name: "大分",number: 1152},
    {code: 45,name: "宮崎",number: 1089},
    {code: 46,name: "鹿児島",number: 1626},
    {code: 47,name: "沖縄",number: 1443}
    ]
});
                    
情報表示エリア

オプションに showHeatlabel を指定するとヒートマップラベルが表示されます。

[ {code: 1,name: "北海道",number: 5320}, {code: 2,name: "青森",number: 1278}, {code: 3,name: "岩手",number: 1255}, {code: 4,name: "宮城",number: 2323}, {code: 5,name: "秋田",number: 996}, {code: 6,name: "山形",number: 1102}, {code: 7,name: "福島",number: 1882}, {code: 8,name: "茨城",number: 2892}, {code: 9,name: "栃木",number: 1957}, {code: 10,name: "群馬",number: 1960}, {code: 11,name: "埼玉",number: 7310}, {code: 12,name: "千葉",number: 6246}, {code: 13,name: "東京",number: 13724}, {code: 14,name: "神奈川",number: 9159}, {code: 15,name: "新潟",number: 2267}, {code: 16,name: "富山",number: 1056}, {code: 17,name: "石川",number: 1147}, {code: 18,name: "福井",number: 779}, {code: 19,name: "山梨",number: 823}, {code: 20,name: "長野",number: 2076}, {code: 21,name: "岐阜",number: 2008}, {code: 22,name: "静岡",number: 3675}, {code: 23,name: "愛知",number: 7525}, {code: 24,name: "三重",number: 1800}, {code: 25,name: "滋賀",number: 1413}, {code: 26,name: "京都",number: 2599}, {code: 27,name: "大阪",number: 8823}, {code: 28,name: "兵庫",number: 5503}, {code: 29,name: "奈良",number: 1348}, {code: 30,name: "和歌山",number: 945}, {code: 31,name: "鳥取",number: 565}, {code: 32,name: "島根",number: 685}, {code: 33,name: "岡山",number: 1907}, {code: 34,name: "広島",number: 2829}, {code: 35,name: "山口",number: 1383}, {code: 36,name: "徳島",number: 743}, {code: 37,name: "香川",number: 967}, {code: 38,name: "愛媛",number: 1364}, {code: 39,name: "高知",number: 714}, {code: 40,name: "福岡",number: 5107}, {code: 41,name: "佐賀",number: 824}, {code: 42,name: "長崎",number: 1354}, {code: 43,name: "熊本",number: 1765}, {code: 44,name: "大分",number: 1152}, {code: 45,name: "宮崎",number: 1089}, {code: 46,name: "鹿児島",number: 1626}, {code: 47,name: "沖縄",number: 1443} ]
人口数
[ {code: 1,name: "北海道",number: 9.3 }, {code: 2,name: "青森",number: 11.0}, {code: 3,name: "岩手",number: 11.2}, {code: 4,name: "宮城",number: 13.5}, {code: 5,name: "秋田",number: 12.5}, {code: 6,name: "山形",number: 12.7 }, {code: 7,name: "福島",number: 14.2}, {code: 8,name: "茨城",number: 14.8}, {code: 9,name: "栃木",number: 14.8}, {code: 10,name: "群馬",number: 15.6}, {code: 11,name: "埼玉",number: 15.9}, {code: 12,name: "千葉",number: 16.8}, {code: 13,name: "東京",number: 16.4}, {code: 14,name: "神奈川",number: 16.9}, {code: 15,name: "新潟",number: 14.5}, {code: 16,name: "富山",number: 15.2}, {code: 17,name: "石川",number: 15.7}, {code: 18,name: "福井",number: 15.6}, {code: 19,name: "山梨",number: 15.7}, {code: 20,name: "長野",number: 13.1}, {code: 21,name: "岐阜",number: 16.9}, {code: 22,name: "静岡",number: 17.6}, {code: 23,name: "愛知",number: 17.0}, {code: 24,name: "三重",number: 16.9}, {code: 25,name: "滋賀",number: 15.8}, {code: 26,name: "京都",number: 17.1}, {code: 27,name: "大阪",number: 17.7}, {code: 28,name: "兵庫",number: 17.8}, {code: 29,name: "奈良",number: 16.0}, {code: 30,name: "和歌山",number: 17.7}, {code: 31,name: "鳥取",number: 16.0}, {code: 32,name: "島根",number: 15.9}, {code: 33,name: "岡山",number: 16.6}, {code: 34,name: "広島",number: 17.2}, {code: 35,name: "山口",number: 16.5}, {code: 36,name: "徳島",number: 17.6}, {code: 37,name: "香川",number: 17.5}, {code: 38,name: "愛媛",number: 17.6}, {code: 39,name: "高知",number: 18.1}, {code: 40,name: "福岡",number: 18.1}, {code: 41,name: "佐賀",number: 17.9}, {code: 42,name: "長崎",number: 18.1}, {code: 43,name: "熊本",number: 18.0}, {code: 44,name: "大分",number: 17.6}, {code: 45,name: "宮崎",number: 18.6}, {code: 46,name: "鹿児島",number: 19.6}, {code: 47,name: "沖縄",number: 24.1} ];
年間平均気温
[ {code: 1,name: "北海道",number: 144}, {code: 2,name: "青森",number: 158}, {code: 3,name: "岩手",number: 133}, {code: 4,name: "宮城",number: 107}, {code: 5,name: "秋田",number: 177}, {code: 6,name: "山形",number: 146}, {code: 7,name: "福島",number: 115}, {code: 8,name: "茨城",number: 99}, {code: 9,name: "栃木",number: 104}, {code: 10,name: "群馬",number: 90}, {code: 11,name: "埼玉",number: 90}, {code: 12,name: "千葉",number: 101}, {code: 13,name: "東京",number: 106}, {code: 14,name: "神奈川",number: 103}, {code: 15,name: "新潟",number: 170}, {code: 16,name: "富山",number: 168}, {code: 17,name: "石川",number: 161}, {code: 18,name: "福井",number: 169}, {code: 19,name: "山梨",number: 82}, {code: 20,name: "長野",number: 110}, {code: 21,name: "岐阜",number: 109}, {code: 22,name: "静岡",number: 106}, {code: 23,name: "愛知",number: 107}, {code: 24,name: "三重",number: 100}, {code: 25,name: "滋賀",number: 127}, {code: 26,name: "京都",number: 104}, {code: 27,name: "大阪",number: 101}, {code: 28,name: "兵庫",number: 90}, {code: 29,name: "奈良",number: 105}, {code: 30,name: "和歌山",number: 102}, {code: 31,name: "鳥取",number: 158}, {code: 32,name: "島根",number: 150}, {code: 33,name: "岡山",number: 96}, {code: 34,name: "広島",number: 108}, {code: 35,name: "山口",number: 126}, {code: 36,name: "徳島",number: 106}, {code: 37,name: "香川",number: 106}, {code: 38,name: "愛媛",number: 107}, {code: 39,name: "高知",number: 122}, {code: 40,name: "福岡",number: 124}, {code: 41,name: "佐賀",number: 115}, {code: 42,name: "長崎",number: 118}, {code: 43,name: "熊本",number: 119}, {code: 44,name: "大分",number: 108}, {code: 45,name: "宮崎",number: 120}, {code: 46,name: "鹿児島",number: 133}, {code: 47,name: "沖縄",number: 137} ];
年間降水日数
[ {code: 1,name: "北海道",number: 383}, {code: 2,name: "青森",number: 362}, {code: 3,name: "岩手",number: 391}, {code: 4,name: "宮城",number: 408}, {code: 5,name: "秋田",number: 376}, {code: 6,name: "山形",number: 419}, {code: 7,name: "福島",number: 404}, {code: 8,name: "茨城",number: 426}, {code: 9,name: "栃木",number: 434}, {code: 10,name: "群馬",number: 412}, {code: 11,name: "埼玉",number: 436}, {code: 12,name: "千葉",number: 456}, {code: 13,name: "東京",number: 471}, {code: 14,name: "神奈川",number: 478}, {code: 15,name: "新潟",number: 366}, {code: 16,name: "富山",number: 408}, {code: 17,name: "石川",number: 383}, {code: 18,name: "福井",number: 383}, {code: 19,name: "山梨",number: 420}, {code: 20,name: "長野",number: 436}, {code: 21,name: "岐阜",number: 392}, {code: 22,name: "静岡",number: 417}, {code: 23,name: "愛知",number: 417}, {code: 24,name: "三重",number: 416}, {code: 25,name: "滋賀",number: 424}, {code: 26,name: "京都",number: 403}, {code: 27,name: "大阪",number: 406}, {code: 28,name: "兵庫",number: 428}, {code: 29,name: "奈良",number: 408}, {code: 30,name: "和歌山",number: 393}, {code: 31,name: "鳥取",number: 375}, {code: 32,name: "島根",number: 408}, {code: 33,name: "岡山",number: 385}, {code: 34,name: "広島",number: 404}, {code: 35,name: "山口",number: 402}, {code: 36,name: "徳島",number: 392}, {code: 37,name: "香川",number: 387}, {code: 38,name: "愛媛",number: 390}, {code: 39,name: "高知",number: 362}, {code: 40,name: "福岡",number: 388}, {code: 41,name: "佐賀",number: 395}, {code: 42,name: "長崎",number: 373}, {code: 43,name: "熊本",number: 381}, {code: 44,name: "大分",number: 386}, {code: 45,name: "宮崎",number: 370}, {code: 46,name: "鹿児島",number: 392}, {code: 47,name: "沖縄",number: 353} ];
平均年収
[ {code: 1,name: "北海道",number: 30.7}, {code: 2,name: "青森",number: 31.8}, {code: 3,name: "岩手",number: 31.9}, {code: 4,name: "宮城",number: 27.2}, {code: 5,name: "秋田",number: 35.6}, {code: 6,name: "山形",number: 32.2}, {code: 7,name: "福島",number: 30.2}, {code: 8,name: "茨城",number: 28.3}, {code: 9,name: "栃木",number: 27.4}, {code: 10,name: "群馬",number: 28.9}, {code: 11,name: "埼玉",number: 26.0}, {code: 12,name: "千葉",number: 27.1}, {code: 13,name: "東京",number: 23.0}, {code: 14,name: "神奈川",number: 24.8}, {code: 15,name: "新潟",number: 31.3}, {code: 16,name: "富山",number: 31.6}, {code: 17,name: "石川",number: 28.8}, {code: 18,name: "福井",number: 29.8}, {code: 19,name: "山梨",number: 29.8}, {code: 20,name: "長野",number: 31.1}, {code: 21,name: "岐阜",number: 29.3}, {code: 22,name: "静岡",number: 29.1}, {code: 23,name: "愛知",number: 24.6}, {code: 24,name: "三重",number: 29.0}, {code: 25,name: "滋賀",number: 25.3}, {code: 26,name: "京都",number: 28.6}, {code: 27,name: "大阪",number: 27.2}, {code: 28,name: "兵庫",number: 28.3}, {code: 29,name: "奈良",number: 30.3}, {code: 30,name: "和歌山",number: 32.2}, {code: 31,name: "鳥取",number: 31.0}, {code: 32,name: "島根",number: 33.6}, {code: 33,name: "岡山",number: 29.7}, {code: 34,name: "広島",number: 28.6}, {code: 35,name: "山口",number: 33.4}, {code: 36,name: "徳島",number: 32.4}, {code: 37,name: "香川",number: 31.1}, {code: 38,name: "愛媛",number: 32.1}, {code: 39,name: "高知",number: 34.2}, {code: 40,name: "福岡",number: 27.1}, {code: 41,name: "佐賀",number: 29.2}, {code: 42,name: "長崎",number: 31.3}, {code: 43,name: "熊本",number: 30.1}, {code: 44,name: "大分",number: 31.8}, {code: 45,name: "宮崎",number: 31.1 }, {code: 46,name: "鹿児島",number: 30.8}, {code: 47,name: "沖縄",number: 21.0} ];
高齢化率
[ {code: 1,name: "北海道",number: 5320}, {code: 2,name: "青森",number: 1278}, {code: 3,name: "岩手",number: 1255}, {code: 4,name: "宮城",number: 2323}, {code: 5,name: "秋田",number: 996}, {code: 6,name: "山形",number: 1102}, {code: 7,name: "福島",number: 1882}, {code: 8,name: "茨城",number: 2892}, {code: 9,name: "栃木",number: 1957}, {code: 10,name: "群馬",number: 1960}, {code: 11,name: "埼玉",number: 7310}, {code: 12,name: "千葉",number: 6246}, {code: 13,name: "東京",number: 13724}, {code: 14,name: "神奈川",number: 9159}, {code: 15,name: "新潟",number: 2267}, {code: 16,name: "富山",number: 1056}, {code: 17,name: "石川",number: 1147}, {code: 18,name: "福井",number: 779}, {code: 19,name: "山梨",number: 823}, {code: 20,name: "長野",number: 2076}, {code: 21,name: "岐阜",number: 2008}, {code: 22,name: "静岡",number: 3675}, {code: 23,name: "愛知",number: 7525}, {code: 24,name: "三重",number: 1800}, {code: 25,name: "滋賀",number: 1413}, {code: 26,name: "京都",number: 2599}, {code: 27,name: "大阪",number: 8823}, {code: 28,name: "兵庫",number: 5503}, {code: 29,name: "奈良",number: 1348}, {code: 30,name: "和歌山",number: 945}, {code: 31,name: "鳥取",number: 565}, {code: 32,name: "島根",number: 685}, {code: 33,name: "岡山",number: 1907}, {code: 34,name: "広島",number: 2829}, {code: 35,name: "山口",number: 1383}, {code: 36,name: "徳島",number: 743}, {code: 37,name: "香川",number: 967}, {code: 38,name: "愛媛",number: 1364}, {code: 39,name: "高知",number: 714}, {code: 40,name: "福岡",number: 5107}, {code: 41,name: "佐賀",number: 824}, {code: 42,name: "長崎",number: 1354}, {code: 43,name: "熊本",number: 1765}, {code: 44,name: "大分",number: 1152}, {code: 45,name: "宮崎",number: 1089}, {code: 46,name: "鹿児島",number: 1626}, {code: 47,name: "沖縄",number: 1443} ]
人口数
[ {code: 1,name: "北海道",number: 9.3 }, {code: 2,name: "青森",number: 11.0}, {code: 3,name: "岩手",number: 11.2}, {code: 4,name: "宮城",number: 13.5}, {code: 5,name: "秋田",number: 12.5}, {code: 6,name: "山形",number: 12.7 }, {code: 7,name: "福島",number: 14.2}, {code: 8,name: "茨城",number: 14.8}, {code: 9,name: "栃木",number: 14.8}, {code: 10,name: "群馬",number: 15.6}, {code: 11,name: "埼玉",number: 15.9}, {code: 12,name: "千葉",number: 16.8}, {code: 13,name: "東京",number: 16.4}, {code: 14,name: "神奈川",number: 16.9}, {code: 15,name: "新潟",number: 14.5}, {code: 16,name: "富山",number: 15.2}, {code: 17,name: "石川",number: 15.7}, {code: 18,name: "福井",number: 15.6}, {code: 19,name: "山梨",number: 15.7}, {code: 20,name: "長野",number: 13.1}, {code: 21,name: "岐阜",number: 16.9}, {code: 22,name: "静岡",number: 17.6}, {code: 23,name: "愛知",number: 17.0}, {code: 24,name: "三重",number: 16.9}, {code: 25,name: "滋賀",number: 15.8}, {code: 26,name: "京都",number: 17.1}, {code: 27,name: "大阪",number: 17.7}, {code: 28,name: "兵庫",number: 17.8}, {code: 29,name: "奈良",number: 16.0}, {code: 30,name: "和歌山",number: 17.7}, {code: 31,name: "鳥取",number: 16.0}, {code: 32,name: "島根",number: 15.9}, {code: 33,name: "岡山",number: 16.6}, {code: 34,name: "広島",number: 17.2}, {code: 35,name: "山口",number: 16.5}, {code: 36,name: "徳島",number: 17.6}, {code: 37,name: "香川",number: 17.5}, {code: 38,name: "愛媛",number: 17.6}, {code: 39,name: "高知",number: 18.1}, {code: 40,name: "福岡",number: 18.1}, {code: 41,name: "佐賀",number: 17.9}, {code: 42,name: "長崎",number: 18.1}, {code: 43,name: "熊本",number: 18.0}, {code: 44,name: "大分",number: 17.6}, {code: 45,name: "宮崎",number: 18.6}, {code: 46,name: "鹿児島",number: 19.6}, {code: 47,name: "沖縄",number: 24.1} ];
年間平均気温
[ {code: 1,name: "北海道",number: 144}, {code: 2,name: "青森",number: 158}, {code: 3,name: "岩手",number: 133}, {code: 4,name: "宮城",number: 107}, {code: 5,name: "秋田",number: 177}, {code: 6,name: "山形",number: 146}, {code: 7,name: "福島",number: 115}, {code: 8,name: "茨城",number: 99}, {code: 9,name: "栃木",number: 104}, {code: 10,name: "群馬",number: 90}, {code: 11,name: "埼玉",number: 90}, {code: 12,name: "千葉",number: 101}, {code: 13,name: "東京",number: 106}, {code: 14,name: "神奈川",number: 103}, {code: 15,name: "新潟",number: 170}, {code: 16,name: "富山",number: 168}, {code: 17,name: "石川",number: 161}, {code: 18,name: "福井",number: 169}, {code: 19,name: "山梨",number: 82}, {code: 20,name: "長野",number: 110}, {code: 21,name: "岐阜",number: 109}, {code: 22,name: "静岡",number: 106}, {code: 23,name: "愛知",number: 107}, {code: 24,name: "三重",number: 100}, {code: 25,name: "滋賀",number: 127}, {code: 26,name: "京都",number: 104}, {code: 27,name: "大阪",number: 101}, {code: 28,name: "兵庫",number: 90}, {code: 29,name: "奈良",number: 105}, {code: 30,name: "和歌山",number: 102}, {code: 31,name: "鳥取",number: 158}, {code: 32,name: "島根",number: 150}, {code: 33,name: "岡山",number: 96}, {code: 34,name: "広島",number: 108}, {code: 35,name: "山口",number: 126}, {code: 36,name: "徳島",number: 106}, {code: 37,name: "香川",number: 106}, {code: 38,name: "愛媛",number: 107}, {code: 39,name: "高知",number: 122}, {code: 40,name: "福岡",number: 124}, {code: 41,name: "佐賀",number: 115}, {code: 42,name: "長崎",number: 118}, {code: 43,name: "熊本",number: 119}, {code: 44,name: "大分",number: 108}, {code: 45,name: "宮崎",number: 120}, {code: 46,name: "鹿児島",number: 133}, {code: 47,name: "沖縄",number: 137} ];
年間降水日数
[ {code: 1,name: "北海道",number: 383}, {code: 2,name: "青森",number: 362}, {code: 3,name: "岩手",number: 391}, {code: 4,name: "宮城",number: 408}, {code: 5,name: "秋田",number: 376}, {code: 6,name: "山形",number: 419}, {code: 7,name: "福島",number: 404}, {code: 8,name: "茨城",number: 426}, {code: 9,name: "栃木",number: 434}, {code: 10,name: "群馬",number: 412}, {code: 11,name: "埼玉",number: 436}, {code: 12,name: "千葉",number: 456}, {code: 13,name: "東京",number: 471}, {code: 14,name: "神奈川",number: 478}, {code: 15,name: "新潟",number: 366}, {code: 16,name: "富山",number: 408}, {code: 17,name: "石川",number: 383}, {code: 18,name: "福井",number: 383}, {code: 19,name: "山梨",number: 420}, {code: 20,name: "長野",number: 436}, {code: 21,name: "岐阜",number: 392}, {code: 22,name: "静岡",number: 417}, {code: 23,name: "愛知",number: 417}, {code: 24,name: "三重",number: 416}, {code: 25,name: "滋賀",number: 424}, {code: 26,name: "京都",number: 403}, {code: 27,name: "大阪",number: 406}, {code: 28,name: "兵庫",number: 428}, {code: 29,name: "奈良",number: 408}, {code: 30,name: "和歌山",number: 393}, {code: 31,name: "鳥取",number: 375}, {code: 32,name: "島根",number: 408}, {code: 33,name: "岡山",number: 385}, {code: 34,name: "広島",number: 404}, {code: 35,name: "山口",number: 402}, {code: 36,name: "徳島",number: 392}, {code: 37,name: "香川",number: 387}, {code: 38,name: "愛媛",number: 390}, {code: 39,name: "高知",number: 362}, {code: 40,name: "福岡",number: 388}, {code: 41,name: "佐賀",number: 395}, {code: 42,name: "長崎",number: 373}, {code: 43,name: "熊本",number: 381}, {code: 44,name: "大分",number: 386}, {code: 45,name: "宮崎",number: 370}, {code: 46,name: "鹿児島",number: 392}, {code: 47,name: "沖縄",number: 353} ];
平均年収
[ {code: 1,name: "北海道",number: 30.7}, {code: 2,name: "青森",number: 31.8}, {code: 3,name: "岩手",number: 31.9}, {code: 4,name: "宮城",number: 27.2}, {code: 5,name: "秋田",number: 35.6}, {code: 6,name: "山形",number: 32.2}, {code: 7,name: "福島",number: 30.2}, {code: 8,name: "茨城",number: 28.3}, {code: 9,name: "栃木",number: 27.4}, {code: 10,name: "群馬",number: 28.9}, {code: 11,name: "埼玉",number: 26.0}, {code: 12,name: "千葉",number: 27.1}, {code: 13,name: "東京",number: 23.0}, {code: 14,name: "神奈川",number: 24.8}, {code: 15,name: "新潟",number: 31.3}, {code: 16,name: "富山",number: 31.6}, {code: 17,name: "石川",number: 28.8}, {code: 18,name: "福井",number: 29.8}, {code: 19,name: "山梨",number: 29.8}, {code: 20,name: "長野",number: 31.1}, {code: 21,name: "岐阜",number: 29.3}, {code: 22,name: "静岡",number: 29.1}, {code: 23,name: "愛知",number: 24.6}, {code: 24,name: "三重",number: 29.0}, {code: 25,name: "滋賀",number: 25.3}, {code: 26,name: "京都",number: 28.6}, {code: 27,name: "大阪",number: 27.2}, {code: 28,name: "兵庫",number: 28.3}, {code: 29,name: "奈良",number: 30.3}, {code: 30,name: "和歌山",number: 32.2}, {code: 31,name: "鳥取",number: 31.0}, {code: 32,name: "島根",number: 33.6}, {code: 33,name: "岡山",number: 29.7}, {code: 34,name: "広島",number: 28.6}, {code: 35,name: "山口",number: 33.4}, {code: 36,name: "徳島",number: 32.4}, {code: 37,name: "香川",number: 31.1}, {code: 38,name: "愛媛",number: 32.1}, {code: 39,name: "高知",number: 34.2}, {code: 40,name: "福岡",number: 27.1}, {code: 41,name: "佐賀",number: 29.2}, {code: 42,name: "長崎",number: 31.3}, {code: 43,name: "熊本",number: 30.1}, {code: 44,name: "大分",number: 31.8}, {code: 45,name: "宮崎",number: 31.1 }, {code: 46,name: "鹿児島",number: 30.8}, {code: 47,name: "沖縄",number: 21.0} ];
高齢化率

5 ヒートマップ色条件 - 条件設定

色を自由自在に操ろう。

Example

$('#jmap').jmap({
    height: "450px",
    showHeatmap: true,
    showHeatlabel: true,
    heatmapLabelUnit: '人'
    heatmapConditions: ["<5000", ">=5000",  ">=8000"], // 色がマッチする条件
    heatmapColors: ["#cccccc", "#FFA500", "#FF0000"],       // マッチした場合のヒートマップの色
    areas: [
    {code: 1,name: "北海道",number: 5320},
    {code: 2,name: "青森",number: 1278},
    {code: 3,name: "岩手",number: 1255},
    {code: 4,name: "宮城",number: 2323},
    {code: 5,name: "秋田",number: 996},
    {code: 6,name: "山形",number: 1102},
    {code: 7,name: "福島",number: 1882},
    {code: 8,name: "茨城",number: 2892},
    {code: 9,name: "栃木",number: 1957},
    {code: 10,name: "群馬",number: 1960},
    {code: 11,name: "埼玉",number: 7310},
    {code: 12,name: "千葉",number: 6246},
    {code: 13,name: "東京",number: 13724},
    {code: 14,name: "神奈川",number: 9159},
    {code: 15,name: "新潟",number: 2267},
    {code: 16,name: "富山",number: 1056},
    {code: 17,name: "石川",number: 1147},
    {code: 18,name: "福井",number: 779},
    {code: 19,name: "山梨",number: 823},
    {code: 20,name: "長野",number: 2076},
    {code: 21,name: "岐阜",number: 2008},
    {code: 22,name: "静岡",number: 3675},
    {code: 23,name: "愛知",number: 7525},
    {code: 24,name: "三重",number: 1800},
    {code: 25,name: "滋賀",number: 1413},
    {code: 26,name: "京都",number: 2599},
    {code: 27,name: "大阪",number: 8823},
    {code: 28,name: "兵庫",number: 5503},
    {code: 29,name: "奈良",number: 1348},
    {code: 30,name: "和歌山",number: 945},
    {code: 31,name: "鳥取",number: 565},
    {code: 32,name: "島根",number: 685},
    {code: 33,name: "岡山",number: 1907},
    {code: 34,name: "広島",number: 2829},
    {code: 35,name: "山口",number: 1383},
    {code: 36,name: "徳島",number: 743},
    {code: 37,name: "香川",number: 967},
    {code: 38,name: "愛媛",number: 1364},
    {code: 39,name: "高知",number: 714},
    {code: 40,name: "福岡",number: 5107},
    {code: 41,name: "佐賀",number: 824},
    {code: 42,name: "長崎",number: 1354},
    {code: 43,name: "熊本",number: 1765},
    {code: 44,name: "大分",number: 1152},
    {code: 45,name: "宮崎",number: 1089},
    {code: 46,name: "鹿児島",number: 1626},
    {code: 47,name: "沖縄",number: 1443}
    ]
});
                    

この地図では人口が800万人以上、500万人以上、500万人未満の3つの条件を指定しています。

[ {code: 1,name: "北海道",number: 5320}, {code: 2,name: "青森",number: 1278}, {code: 3,name: "岩手",number: 1255}, {code: 4,name: "宮城",number: 2323}, {code: 5,name: "秋田",number: 996}, {code: 6,name: "山形",number: 1102}, {code: 7,name: "福島",number: 1882}, {code: 8,name: "茨城",number: 2892}, {code: 9,name: "栃木",number: 1957}, {code: 10,name: "群馬",number: 1960}, {code: 11,name: "埼玉",number: 7310}, {code: 12,name: "千葉",number: 6246}, {code: 13,name: "東京",number: 13724}, {code: 14,name: "神奈川",number: 9159}, {code: 15,name: "新潟",number: 2267}, {code: 16,name: "富山",number: 1056}, {code: 17,name: "石川",number: 1147}, {code: 18,name: "福井",number: 779}, {code: 19,name: "山梨",number: 823}, {code: 20,name: "長野",number: 2076}, {code: 21,name: "岐阜",number: 2008}, {code: 22,name: "静岡",number: 3675}, {code: 23,name: "愛知",number: 7525}, {code: 24,name: "三重",number: 1800}, {code: 25,name: "滋賀",number: 1413}, {code: 26,name: "京都",number: 2599}, {code: 27,name: "大阪",number: 8823}, {code: 28,name: "兵庫",number: 5503}, {code: 29,name: "奈良",number: 1348}, {code: 30,name: "和歌山",number: 945}, {code: 31,name: "鳥取",number: 565}, {code: 32,name: "島根",number: 685}, {code: 33,name: "岡山",number: 1907}, {code: 34,name: "広島",number: 2829}, {code: 35,name: "山口",number: 1383}, {code: 36,name: "徳島",number: 743}, {code: 37,name: "香川",number: 967}, {code: 38,name: "愛媛",number: 1364}, {code: 39,name: "高知",number: 714}, {code: 40,name: "福岡",number: 5107}, {code: 41,name: "佐賀",number: 824}, {code: 42,name: "長崎",number: 1354}, {code: 43,name: "熊本",number: 1765}, {code: 44,name: "大分",number: 1152}, {code: 45,name: "宮崎",number: 1089}, {code: 46,name: "鹿児島",number: 1626}, {code: 47,name: "沖縄",number: 1443} ]

6 タッチ&フィール - 全ての設定

自らの手で触れてみよう。

Example

$('#jmap').jmap({
    id: null,   // 地図の識別子
    width: '100%',  // 地図の横幅
    height: '100%', // 地図の縦幅
    viewType: 'map',    // 地図の種類
    gridNumber: 6,      // グリッド表示の列数
    gridOffset: 1,      // グリッド表示の開始列数
    backgroundColor: 'transparent', // 地図背景の色
    backgroundRadius: '0',          // 地図背景の角丸
    backgroundPadding: '0',         // 地図背景の余白
    lineColor: 'transparent',   // 地図背景枠線の幅
    lineWidth: 0,               // 地図背景枠線の色
    lineStyle: 'solid',         // 地図背景枠線の書式
    showIslandDivider: true,    // 遠島区切り線の有無
    dividerWidth: '1px',        // 遠島区切り線の幅
    dividerColor: '#bfbfbf',    // 遠島区切り線の色
    dividerStyle: 'solid',      // 遠島区切り線の書式
    font: 'inherit',    // 都道府県名フォント
    fontSize: '12px',   // 都道府県名フォントのサイズ
    fontColor: '#fff',  // 都道府県名フォントの色
    textNowrap: false,  // 
    selectable: true,   // 都道府県マウスホバーの有無
    cursor: 'pointer',  // 都道府県マウスホバーのカーソル
    showTextShadow: false,      // 都道府県名ドロップシャドーの有無
    textShadowWidth: '2px',     // 都道府県名ドロップシャドーの幅
    textShadowColor: '#000',    // 	都道府県名ドロップシャードの色
    showPrefectureName: true,               // 都道府県名の有無
    prefectureNameType: 'short',            // 都道府県名の表示形式
    prefectureClass: 'jmap-pref',           // 都道府県の共通CSSクラス
    prefectureBackgroundColor: '#333',      // 都道府県の色
    prefectureBackgroundHoverColor: '#666', // 都道府県マウスオーバ―時の色
    prefectureLineGap: '1px',               // 都道府県枠線の間隔
    prefectureLineWidth: '1px',             // 都道府県枠線の幅
    prefectureLineColor: '#fff',            // 都道府県枠線の色
    prefectureLineHoverColor: '#aa1a00',    // 都道府県マウスオーバ―時の枠線の色
    prefectureLineY: '0px',                 // 都道府県枠線のY軸開始位置
    prefectureLineX: '0px',                 // 都道府県枠線のX軸開始位置
    prefectureRadius: '3px',                // 都道府県枠の角丸
    showInfobox: false,             // 情報表示エリアの有無
    infoboxClass: 'jmap-infobox',   // 情報表示エリアのCSSクラス
    infoboxContent: '',             // 情報表示エリアのコンテンツ
    infoboxBackgroundColor: 'transparent',  // 
    skew: '0',                  // 地図の歪み角度
    showTextNoneSkewed: true,   // 地図歪み時の文字の角度
    showHeatmap: false,         // 都道府県のヒートマップ表示
    showHeatlabel: false,       // 都道府県のヒートラベル表示
    heatmapColors: [],          // 都道府県のヒートマップ色配列
    heatmapFontColors: [],      // 都道府県のヒートマップフォント色配列
    heatmapType: 'HRed',        // 都道府県のヒートマップタイプ
    containerClass: 'jmap-container', 
    contentClass: 'jmap-content',
    dividerClass: 'jmap-divider',
    // 地図が読み込まれた際に呼び出されます
    onLoad: function(e, data) {

    },
    // 都道府県が選択された際に呼び出されます
    onSelect: function(e, data) {

    },
    // 都道府県にマウスオーバーした際に呼び出されます
    onHover: function(e, data) {

    },
    // 
    onMouseout: function(e, data) {

    },
    areas: [] // 都道府県別のオブジェクト
});
                    

7 オリジナリティー - 独自設定

感性の赴くままにデザインしよう。

JmapはHTMLとCSSで構成された地図を出力します。もちろん自分が作成したCSSやJavascriptで直接操作する事ができます。

Class Name
クラス名
Description
説明
CSS Selector
セレクター
jmap-container Jmapのラッパーに付与されるクラス名です。 .jmap-container {}
jmap-container[jmap-id="{id}"] 複数の地図がある場合、それぞれの地図を識別するためのセレクターです。この{id}の値は、Jmapのオプションパラメーターidを指定すると変更する事ができます。通常時は連番の整数値です。 .jmap-container[jmap-id="{id}"] {}
jmap-content Jmapのコンテンツラッパーに付与されるクラス名です。 .jmap-content {}
jmap-pref Jmapの全都道府県に共通で付与されるクラス名です。 .jmap-container { background-color:#0f0; }
jmap-pref[jmap-pref="都道府県コード"] Jmapの各都道府県に都道府県コード別に付与されるクラス名です。 .jmap-pref[jmap-pref="都道府県コード"] { background-color:#f00; }
jmap-infobox Jmapの情報表示エリアに付与されるクラス名です。 .jmap-infobox { background-color:#f00; }
jmap-divider Jmapの遠島区分け線に付与されるクラス名です。 .jmap-divider { border-bottom-color:#f00; }

* リファレンス - パラメーター

豊富なパラメーターが用意されています。

Parameter
パラメーター
Description
説明
Default
初期値
id 地図の識別子 地図の大外HTMLの一意な識別子 jmap-id 属性の値を指定できます jmap-{一意な整数}
width 地図の横幅 値の単位を入力しない場合は、px が適用されます 100%
height 地図の縦幅 値の単位を入力しない場合は、px が適用されます 100%
viewType 地図の種類 日本地図 map か、グリッド表示 grid かを指定できます map
gridNumber グリッド表示の列数 viewTypegrid の時にグリッド表示の列数を指定できます 行数は列数に応じて変化します 6
gridOffset グリッド表示の開始列数 viewTypegrid の時にグリッド表示の開始列数を指定できます 1
backgroundColor 地図背景の色 地図背景の色を色文字#rgb-hexrgb(dec,dec,dec)で指定できます transparent
backgroundRadius 地図背景の角丸 地図背景の角丸を指定できます 0
backgroundPadding 地図背景の余白 地図背景と地図の余白を指定できます 0
lineWidth 地図背景枠線の幅 地図背景の枠線幅を指定できます 0
lineColor 地図背景枠線の色 地図背景の枠線の色を色文字#rgb-hexrgb(dec,dec,dec)指定できます transparent
lineStyle 地図背景枠線の書式 地図背景の枠線の書式をCSSの border-style の形式で指定できます solid
showIslandDivider 遠島区切り線の有無 沖縄の区切り線の有無を指定できます true
dividerWidth 遠島区切り線の幅 沖縄の区切り線の幅を指定できます 1px
dividerColor 遠島区切り線の色 沖縄の区切り線の色を色文字#rgb-hexrgb(dec,dec,dec)指定できます #bfbfbf
dividerStyle 遠島区切り線の書式 沖縄の区切り線の書式をCSSの border-style の形式で指定できます solid
font 都道府県名フォント 都道府県名のフォントをfont-family の形式で指定できます inherit
fontSize 都道府県名フォントのサイズ 都道府県名のフォントの大きさを指定できます 12px
fontColor 都道府県名フォントの色 都道府県名のフォントの色を色文字#rgb-hexrgb(dec,dec,dec)指定できます #fff
selectable 都道府県マウスホバーの有無 都道府県のマウスホバー時のエフェクト有無を指定できます true
cursor 都道府県マウスホバーのカーソル 都道府県のマウスホバー時のカーソルを指定できます 尚、 selectableの値が false だった場合、default が適用されます。 pointer
showTextShadow 都道府県名ドロップシャドーの有無 都道府県名ドロップシャドーの有無を指定できます false
textShadowWidth 都道府県名ドロップシャドーの幅 都道府県名ドロップシャドーの幅を指定できます 2px
textShadowColor 都道府県名ドロップシャードの色 都道府県名ドロップシャードの色を指定できます #000
showPrefectureName 都道府県名の有無 都道府県名表示の有無を指定できます true
prefectureNameType 都道府県名の表示形式 都道府県名の書式を、都府県なし: short、都府県あり: full、アルファベット: alphabet から指定できます true
prefectureClass 都道府県の共通CSSクラス 都道府県の共通CSSクラスを指定できます true
prefectureBackgroundColor 都道府県の色 指都道府県の色を色文字#rgb-hexrgb(dec,dec,dec)で指定できます #333
prefectureBackgroundHoverColor 都道府県マウスオーバ―時の色 都道府県マウスオーバ―時の色を色文字#rgb-hexrgb(dec,dec,dec)で指定できます #666
prefectureLineGap 都道府県枠線の間隔 都道府県の間隔を指定できます 1px
prefectureLineWidth 都道府県枠線の幅 都道府県の枠線幅を指定できます 1px
prefectureLineColor 都道府県枠線の色 指都道府県の枠線の色を色文字#rgb-hexrgb(dec,dec,dec)で指定できます #fff
prefectureLineHoverColor 都道府県マウスオーバ―時の枠線の色 都道府県マウスオーバ―時の枠線の色を色文字#rgb-hexrgb(dec,dec,dec)で指定できます #aa1a00
prefectureLineY 都道府県枠線のY軸開始位置 都道府県枠線のY軸開始位置を指定できます 0px
prefectureLineX 都道府県枠線のX軸開始位置 都道府県枠線のX軸開始位置を指定できます 0px
prefectureRadius 都道府県枠の角丸 都道府県枠の角丸を指定できます 3px
showInfobox 情報表示エリアの有無 情報表示エリアの表示有無を指定できます 尚、Jmap地図を表示する要素内に jmap-infobox クラスを持つ要素がある場合、情報表示エリア内に表示されます false
infoboxClass 情報表示エリアのCSSクラス 情報表示エリアのCSSクラスを指定できます false
infoboxContent 情報表示エリアのコンテンツ 情報表示エリアのコンテンツを直接指定できます
skew 地図の歪み角度 地図の歪み角度を指定できます 0
showTextNoneSkewed 地図歪み時の文字の角度 地図の歪み角度指定時に文字も同時に歪ませるかを指定できます true
showHeatmap 都道府県のヒートマップ表示 areas が指定され、都道府県のオブジェクトに number が指定されている際に、numberの最大値に対する各都道府県のnumberの比率でヒートマップ表示されます false
showHeatlabel 都道府県のヒートラベル表示 ヒートマップの10段階の色調変化バーを表示します false
heatmapColors 都道府県のヒートマップ色配列 ヒートマップの色配列を指定できます。heatmapConditionsを利用しない場合は10色を指定します。
参考例 heatmapColors: ["#BFC7CE ", "#f7fbff ", "#deebf7 ", "#c6dbef ", "#9ecae1 ", "#6baed6 ", "#4292c6 ", "#2171b5 ", "#08519c ", "#08306b "]
[]
heatmapLabelUnit ヒートマップの数字の単位 ヒートマップの数字の単位を指定しラベルに表示できます。
参考例 heatmapLabelUnit: '人'
[]
heatmapConditions 都道府県のヒートマップ色条件 ヒートマップの色に合致する条件を指定する事ができます。小さい値から順に定義します。heatmapConditionsを指定した場合、heatmapColorsは条件の数を指定する必要があります。
参考例 heatmapConditions: ["<1000", ">=1000", ">=1000", ">=2000", ">=4000", ">=8000"];
[]
heatmapFontColors 都道府県のヒートマップフォント色配列 ヒートマップフォント色の配列10色を指定できます
参考例 heatmapFontColors: ["#000 ", "#000 ", "#000 ", "#000 ", "#000 ", "#fff ", "#fff ", "#fff ", "#fff ", "#fff "]
[]
heatmapType 都道府県のヒートマップタイプ ヒートマップの色を36種類から指定できます
種別 色の範囲
HRed
HBlue
OrRd
PuBu
BuPu
Oranges
BuGn
YlOrBr
YlGn
Reds
RdPu
Greens
YlGnBu
Purples
GnBu
Greys
YlOrRd
PuRd
Blues
PuBuGn
Spectral
RdYlGn
RdBu
PiYG
PRGn
RdYlBu
BrBG
RdGy
PuOr
Set2
Accent
Set1
Set3
Dark2
Paired
Pastel2
Pastel1
Font
HRed
onLoad 地図が読み込まれた際に呼び出されます
引数 説明
第1引数 Event Object イベントオブジェクト
第2引数 Prefecture Data Object 都道府県情報が格納されたオブジェクトが返却されます
なし
onSelect 都道府県が選択された際に呼び出されます
引数 説明
第1引数 Event Object イベントオブジェクト
第2引数 Prefecture Data Object 都道府県情報が格納されたオブジェクトが返却されます
なし
onHover 都道府県にマウスオーバーした際に呼び出されます
引数 説明
第1引数 Event Object イベントオブジェクト
第2引数 Prefecture Data Object 都道府県情報が格納されたオブジェクトが返却されます
なし
onHoverHeatMapLabel ヒートマップのラベルにマウスオーバーした際に呼び出されます
引数 説明
第1引数 Event Object イベントオブジェクト
第2引数 Label Data Object ラベルの値情報が格納されたオブジェクトが返却されます
なし
onSelectHeatMapLabel ヒートマップのラベルが選択された際に呼び出されます
引数 説明
第1引数 Event Object イベントオブジェクト
第2引数 Label Data Object ラベルの値情報が格納されたオブジェクトが返却されます
なし
areas 都道府県別のオブジェクトを配列に格納すればオブジェクト内の47都道府県コード(code)を元に、独自の名前(name)、背景色(color)、ホバー時の背景色(hoverColor)を指定できます。
必須 パラメーター 説明
必須 code 47都道府県コード
任意 name 枠に表示する名前
任意 color 背景色
任意 hoverColor マウスオーバ―時の背景色
任意 number heatmap パラメータを true に設定している場合、numberの値を元に計算が行われます
[]

* 互換性 - 他プラグイン

もとめる地図に出会おう。