How to get the geolocation column

There are a number of blogs already written about how to get the Geolocation column on your SharePoint site, but a lot of sites use the wrong syntax for the field XML. Even the MSDN site for adding the geolocation column to your site is incomplete.

The correct XML to use is:

The important part here is the addition of the Name property in the field definition. The complete script to add it to your site is:

For this script I used these OfficeDevPnP PowerShell CmdLets

The geolocation field uses Bing maps, so when you enable the geolocation field, you need a key to use the maps.

You can get this key by going to https://www.bingmapsportal.com/. In this portal you can create a new key or get an existing key

After you created the key you get an overview of all your keys

After getting the key you can set it to the web properties of the site where you use the geolocation field. This can also be done with one of the Office Dev PnP PowerShell commands: “Set-SPOPropertyBagValue”

Now you have a fully working geolocation field in your list.