[WordPress] 外掛分享: Japan Clickable Map

首頁 › 外掛目錄 › Japan Clickable Map
WordPress 外掛 Japan Clickable Map 的封面圖片
10+
安裝啟用
—
尚無評分
剛更新
最後更新
—
問題解決
WordPress 6.6+ PHP 8.1+ v1.1.1 上架:2026-08-09

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Japan Clickable Map」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Japan Clickable Map turns a plain map of Japan into a navigation element: an
interactive SVG map with 47 clickable prefectures. You build a map in the
WordPress admin — pick which prefectures to show, give them colors and link
targets per prefecture or region — and then place it in any post, page or
custom post type with a shortcode or a block.
The map is rendered as inline SVG on the server. There is no external map
service, no API key and no JavaScript library to load: the front end only ships
a small script when a region popover is actually used.
The documentation walks
through building and placing a map step by step, and also covers legends, pins,
styling with CSS, the developer hooks and troubleshooting.
Building a map

Map range — show all 47 prefectures (full), or only the prefectures you
pick (range). Any combination of prefectures is allowed.
Detail level — choose between low, low-smooth, mid and high outline
accuracy, so you can trade file size for coastline detail. low-smooth keeps the
simplified low outline but joins its points with curves for a softer coastline.
Insets — Okinawa is moved into an inset at the top left of the map frame
instead of stretching it. The Northern Territories and the Ogasawara Islands
stay at their actual positions.
Grouping (full mode) — treat each prefecture as its own clickable area, or
group prefectures into regions. Regions can follow Japan’s standard eight
regions (Hokkaido, Tohoku, Kanto, Chubu, Kinki, Chugoku, Shikoku, Kyushu), or
you can define your own grouping per map.
Region behavior — a region can link straight to a URL, or open a popover
listing the destinations inside it (hover or click).
Colors — set a default fill for the map and override it per prefecture.
Links — set a link per prefecture or per region. A prefecture with no link
is not clickable and does not change the cursor.
Link targets — links for prefectures, regions, legend areas and pins take
a URL. Each destination listed in a region’s popover can also be a post, page,
custom post type entry or taxonomy term picked by searching your site, so it
keeps working when permalinks change.
Labels — prefecture and region names are drawn on the map and exposed to
screen readers as aria-label. Any label can be overridden per prefecture.
Legend — show a legend of your areas below the map. With “By region” it
lists the regions or your custom areas. In the other modes you define areas
on the “Legend areas” tab, and each area also colors its prefectures and
links them to the area’s URL.
Pins — mark places such as shops or offices with pins that carry an
optional label and link. Place a pin by clicking the map in the preview, or
type its coordinates. One pin image is shared by all maps: a default is
bundled, and you can choose your own under Settings.
Color presets — save the palettes you use often and reuse them across
maps.
Preview — check the finished map in a modal without leaving the editor.

Placing a map
Shortcode:
[plg_jcm_map id="123"]

Optional attributes: level (low / low-smooth / mid / high) to override
the detail level saved on the map, and class to add your own CSS class.
Or insert the Clickable Map of Japan block and choose which map to display. The
block stores only the map ID and renders on the server, so editing a map updates
every place it is embedded.
Prefecture level, without limits
Every option above is available here, and you can create as many prefecture maps
as you like. What the paid edition adds is a different level of detail:
maps at municipality level, where the clickable areas are cities, towns and
wards rather than prefectures, and where those areas can be grouped across
prefecture borders.
For developers
Themes and other plugins can change a map through 8 hooks. Every name starts
with plg_jcm_, and the paid edition uses the same names and arguments.

plg_jcm_loaded (action) — the plugin has loaded and set itself up.
plg_jcm_config (filter) — a map’s saved settings, before it is rendered on the site.
plg_jcm_allowed_levels (filter) — the detail levels a map may use.
plg_jcm_svg_file (filter) — the path of the base SVG map for a detail level.
plg_jcm_pref_path_attrs (filter) — the fill color, accessible name and link of one prefecture.
plg_jcm_svg_dom (action) — the finished SVG as a DOMDocument, just before it is output.
plg_jcm_allowed_html (filter) — the wp_kses allowlist for the map SVG.
plg_jcm_map_html (filter) — the final HTML of the shortcode or block.

If you add elements in plg_jcm_svg_dom, allow them in plg_jcm_allowed_html
too: anything that is not on the allowlist is removed from the output. Where a
hook passes $kind, it is always pref here; the paid edition also passes muni
for municipality maps. Every hook’s arguments, with examples, are described in
the documentation.
Map data
The bundled SVG maps in assets/svg/ are derived from the National Land
Numerical Information (Administrative Zones Data, N03) published by the
Ministry of Land, Infrastructure, Transport and Tourism of Japan (data as of
1 January 2024).

Source: https://nlftp.mlit.go.jp/ksj/gml/datalist/KsjTmplt-N03-v3_1.html
Terms: https://nlftp.mlit.go.jp/ksj/other/agreement_01.html — the Japanese
Government Standard Terms of Use (version 2.0), which are compatible with
CC BY 4.0. Modification, redistribution and commercial use are permitted as
long as the source is credited.

Processing applied to the original data: administrative polygons dissolved into
prefecture outlines, reprojection to Web Mercator (EPSG:3857), Okinawa moved
into an inset, vertex simplification, conversion to SVG, and the addition of
identifying attributes. See assets/svg/japan/README.md for details.
If you display these maps, please credit the source somewhere visible on the
page (a footer or a caption is fine):

「国土数値情報(行政区域データ)」(国土交通省)
(https://nlftp.mlit.go.jp/ksj/gml/datalist/KsjTmplt-N03-v3_1.html) を加工して作成

延伸相關外掛

文章
Filter
Mastodon