Charts · Gutenberg
World Map block for WordPress
Interactive SVG world map with country highlighting, data values, tooltips and a legend. Perfect for global presence, customer distribution, and sales territory sections.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Interactive SVG world map with country highlighting, data values, tooltips and a legend. Perfect for global presence, customer distribution, and sales territory sections.
Inspector panels on this block: Countries, Display, Map Style, Tooltip Style, Country List Style, Colours, Appearance. Those titles come from index.js, not from a shared template.
Behavior controls: “Color mode” options: Gradient by value, Uniform fill, Per-country custom color; “Projection” options: Natural Earth, Mercator, Equirectangular, Robinson.
Where to find it
Gutenberg inserter → Charts → search “World Map” (block name `blockenberg/world-map` in block.json). Style it in the sidebar after insert.
How to use World Map block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “World Map”, insert it. Category: Charts.
- Configure inspector controls that exist on this block. Open Countries. Set “Country name”, “Code (ISO)”, “Value / Count”, “Link URL”.
- Check the published page. The view script reads HTML data attributes: data-countries, data-opts. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Country name | Text field in the inspector. |
| Code (ISO) | Text field in the inspector. |
| Value / Count | Text field in the inspector. |
| Link URL | Text field in the inspector. |
| Show title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Display — Title | Text field in the inspector. block.json default: Global Presence. Saved as `title`. |
| Show subtitle | On/off toggle in the inspector. On by default. Saved as `showSubtitle`. |
| Subtitle | Text field in the inspector. block.json default: Serving customers across 10+ countries worldwide.. Saved as `subtitle`. |
| Show legend | On/off toggle in the inspector. On by default. Saved as `showLegend`. |
| Legend title | Text field in the inspector. block.json default: Customers. Saved as `legendTitle`. |
| Show tooltips on hover | On/off toggle in the inspector. On by default. Saved as `showTooltips`. |
| Show country list below map | On/off toggle in the inspector. On by default. Saved as `showCountryList`. |
| Map height (px) | Numeric range control in the inspector. Range 200–800. block.json default: 480. Saved as `mapHeight`. |
| Color mode | Select control; the chosen value is saved on the block. Options: Gradient by value; Uniform fill; Per-country custom color. block.json default: gradient. Saved as `colorMode`. |
| Projection | Select control; the chosen value is saved on the block. Options: Natural Earth; Mercator; Equirectangular; Robinson. block.json default: NaturalEarth1. Saved as `projection`. |
| Card radius (px) | Numeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `cardRadius`. |
| Padding top (px) | Numeric range control in the inspector. Range 0–200. block.json default: 60. Saved as `paddingTop`. |
| Padding bottom (px) | Numeric range control in the inspector. Range 0–200. block.json default: 60. Saved as `paddingBottom`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-countries, data-opts.
- An IntersectionObserver starts work when the block enters the viewport.
When this is the right block
- Interactive SVG world map with country highlighting, data values, tooltips and a legend. Perfect for global presence, customer distribution, and sales territory sections — that is the job of World Map, not a generic content block.
- Use it when you need the editor control labeled “Country name”, which exists on this block’s inspector.
- It matches pages about map, world, countries.
- Inserter grouping: reports, dashboards, and data-heavy pages.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the World Map block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “World Map”. It sits under Charts. After insert, open Countries and set “Country name”, “Code (ISO)”, “Value / Count”, “Link URL”.
What makes World Map different from other Blockenberg blocks?
Interactive SVG world map with country highlighting, data values, tooltips and a legend. Perfect for global presence, customer distribution, and sales territory sections. Inspector labels on this block include “Country name”, “Code (ISO)”, “Value / Count”, “Link URL”.
Is the World Map Gutenberg block free?
Yes. World Map ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style World Map to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Countries, Display, Map Style, Tooltip Style).
Related charts blocks
Area Chart
Smooth filled area chart with multiple datasets, gradient fills, and animation using Chart.js (CDN). Great for showing trends over time.
Bar Chart
Vertical or horizontal bar chart with multiple datasets using Chart.js (CDN). Supports stacked, border radius, and custom colors.
Bubble Chart
Interactive bubble chart powered by Chart.js.
Data Table
Interactive data table with sorting, search, pagination and export.
Doughnut Chart
Pie/doughnut chart with adjustable cutout, center label, and per-slice colors using Chart.js (CDN).
Line Chart
Interactive line chart using Chart.js (loaded from CDN). Supports multiple datasets, fill, tension, and grid styling.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert World Map from the Gutenberg inserter.