API Key Registration
In order to use this plugin you must first register with the Ordnance Survey for an API key. Head over to the Data Hub website and signup for a free account. Once you’ve signed in, follow the instructions on the Getting Started page to generate a Maps API key. You will need this key after you have installed the plugin.
The other thing you will want to do, assuming you want to show Landranger and Explorer maps, is to upgrade your OS account to Premium. This gives you permission to access their premium data, which includes these maps styles and also the highly detailed scales beyond 1:25,000.
There is no monthly cost associated with a premium account. The pricing page does show a charge per map tile but there is a free monthly allowance. This is large enough that most smaller sites will not even come close to using. It’s counted in map tiles, but OS estimates that it equates to about 2,000,000 map views per month.
You don’t have to provide any credit card details when you opt for premium, and if you don’t and you exceed your allowance, your maps will simply stop being shown, so there is no chance of receiving a huge unexpected bill. There are other settings which we’ll come to later which can help with controlling access.
Note also that there is no premium version of the plugin. The standard free plugin covers everything you need.
The easiest way to install the plugin is directly from your WordPress dashboard. Go to the Add New Plugin page and search for DataHub, then click on Install. Alternatively you can go to the plugin page on wordpress.org and download it.
After installing you will need to Activate the plugin. Once activated, you will be prompted to enter your API key on the settings page.
Testing the Plugin
Edit a page or post and just add an
[osmap] shortcode to your page. If your API key is set up correctly, when you view the page (you won’t see the map in the page editor) this will display a map with the default height and zoom level, centred on Ordnance Survey headquarters in Southampton.
It should look something like this. OS headquarters is the E-shaped building in the middle.Up Settings Page »