Linux 软件免费装
Banner图

Japan Clickable Map

开发者 plugear
更新时间 2026年12月2日 19:57
PHP版本: 8.1 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

japan interactive map svg map clickable map prefecture

下载

1.0.0 1.0.1 1.1.0 1.1.1

详情介绍:

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 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. 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). 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) を加工して作成

安装:

  1. Upload the plugin to /wp-content/plugins/japan-clickable-map/, or install it from Plugins → Add New in your dashboard.
  2. Activate it through the Plugins screen.
  3. Go to Clickable Maps → Add New, choose the prefectures, colors and links, then publish.
  4. Insert the Clickable Map of Japan block and pick your map from the list, or place the shortcode [plg_jcm_map id="123"] by hand — 123 is the map ID, which is the post= value in the address bar while you edit that map.
Building the block from source The editor script in block/build/ is compiled with @wordpress/scripts. The unminified sources ship in block/src/. To rebuild: npm install && npm run build:block

屏幕截图:

  • Clicking a region opens a popover carrying its own heading, body text and links.
  • The map editor. Prefectures are listed by region, and colors and links can be overridden one prefecture at a time.
  • Colors: a default fill plus a color per region, with your saved presets next to every picker.
  • The preview modal inside the editor, so you can check a map without leaving the edit screen.
  • Placing a map with the block. The block stores only the map ID and renders on the server.
  • Saved color presets, reusable across maps.
  • A legend below the map. Here the prefectures are grouped into legend areas for delivery times, each with its own color; prefectures in no area share one row whose label you choose.
  • Pins mark places such as branch offices. Each pin can carry a label and a link.
  • The "Legend areas" and "Pins" tabs of the map editor. Prefectures join an area on the "Prefecture selection / overrides" tab, and a pin is placed by clicking the map in the preview or by typing its coordinates.

升级注意事项:

1.1.1 Fixes a conflict with the paid edition on sites that still have the old self-hosted copy, and links the description to the documentation. No changes to your saved maps. 1.1.0 Adds map legends, pins and developer hooks. Your existing maps look the same until you turn these on. 1.0.1 Fixes admin text that appeared in Japanese on non-Japanese sites, and an empty prefecture counter outside Japanese. No changes to your saved maps. 1.0.0 First release.

常见问题:

Does the map need an API key or an external service?

No. The maps are SVG files bundled with the plugin and rendered on your own server. Nothing is requested from a third party, and the plugin makes no outbound HTTP requests at all.

Can I show only part of Japan?

Yes. Set the map range to range and pick the prefectures you want. Only those are drawn, and the viewBox is fitted to them.

Can a click open a category or a specific post?

Yes. Every link takes a URL, so you can enter the address of the category or post. For the destinations listed in a region's popover you can instead search your site and select a post, page, custom post type entry or taxonomy term. That link is resolved at render time, so it survives permalink changes.

Are the maps accessible?

Clickable areas are real links with an aria-label carrying the prefecture or region name. Prefectures without a link are inert and are not focusable. A pin with a link is a link as well. Its accessible name is the pin's label or, when the pin has no label, "Pin:" followed by the host name of the link. The legend is a list with its own aria-label.

Can I mark shops or offices on the map?

Yes. Add them on the "Pins" tab of the map editor. A pin can have a label and a link, and you place it by clicking the map in the preview. The pin image is set once for all maps under Clickable Maps → Settings.

The map is too wide on mobile.

The SVG scales to the width of its container. Wrap the shortcode in your own element, or add a class with the class attribute and size it in your theme's CSS.

What happens to my maps if I uninstall the plugin?

Nothing is deleted by default. If you want a clean removal, enable Delete all data for this plugin on uninstall on the plugin's settings screen before you delete the plugin. The pin image you chose under Settings is an ordinary file in your Media Library, so it stays there even when the plugin's data is removed.

What does the paid edition add?

Municipality-level maps: the clickable areas become cities, towns and wards instead of prefectures, and they can be grouped across prefecture borders.

更新日志:

1.1.1 1.1.0 1.0.1 1.0.0