Subdividing USA states to create custom regions

If you need to create sub-regions of a state in the US map, one approach could be to create individual state maps, where you create groups of regions with counties and they overlay those maps in the main US map. The result could be something like the example below:

The result is not perfect, but it’s usable in most scenarios.

This is achieved by using the individual county codes in a single region entry, in the state map:

Subdividing USA states to create custom regions

In addition to creating groups, in the individual state map of the example below, we also set the borders to be 0px, so that the state borders are less visible. If you have the groups coloured the same way, you can set the border colour to be that same colour, instead of setting it to 0px. Another approach to improve the county borders issue could be to create individual maps for each group and this way you can set the border colour individually for those maps. In the example above you would end up having 3 maps in addition to the base map.

Other solutions to create custom regions, would include the creation of custom geojson files, which might not be so easy.

Google Sheets API v3 being deprecated

Google will be deprecating the Sheets API v3, that allowed us to get a particular URL format to get a public spreadsheet in JSON format, capable of populating the maps, as described in our documentation article.

From August 2021 the requests to those JSON urls might fail. If you were using the method described in our documentation page using the JSON approach, your maps might start to work intermittently or stop displaying data because of this. There might be cases where the data displays, but won’t update, meaning they are displaying a cached version, since it can’t get new versions.

We’ve been working on a workaround solution and a specific feature to display data from a Google Spreadsheet, but this will require a Google API Key also. The new feature will be available from version 1.4.12 and looks like this:

Google Sheets API v3 being deprecated

If you’re reading this article and still don’t see the new feature, you can update to the latest beta version.

Here’s what you’ll need:

  • If your spreadsheet already had the format suggested in our documentation article, you don’t need to change anything in the spreadsheet. It should have the first row as the headers/names in each column and the data entries on each row;
  • When editing the spreadsheet, you can get the Spreadsheet ID in the URL;
  • You’ll need a Google API Key with the Spreadsheets service enabled;
  • The Sheet range option is usually the name of the sheet, usually Sheet1;
  • The ID property is mandatory and should be the title of the column that contains the region codes (or unique text identifier for markers);
  • The Action Content Property is optional.

You can refer to the documentation page for more details. If you have problems migrating the service, contact us.

Counties and Unitary Authorities in the UK

The UK can be subdivided in many different ways and the plugin is not able offer all of them. However, with the Pro version we can include custom geojson map sources to generate the maps. That’s what we did here to get the map of  Counties and Unitary Authorities in the UK.

We used a dataset from the Open Geography Portal, provided by the Office for National Statistics. We then used some of the tools available to make the map compatible with the plugin. This is the generated geojson file.