In order to use the full feature of the SharePoint Geolocation column, we need to first set the Bing Maps API Key in our SharePoint environment.
Before jumping to the solution, here’s a quick note
We first need to obtain the Bing Maps API Keys in order to use them. You can learn more about how to obtain this key here.
Once we have our key, we need to set the same into our SharePoint environment. In this respect, we’ve couple of options
- Set this key at the Farm level. This will make it available for every Site Collection.
- Set this key at the Site Collection level thereby, making it available for the given Site Collection only.
Set the Bing Maps key at the site level
We can use this option to set this key at the web level. This will limit its usage to this particular site only.
In order to run this cmdlet, SharePoint Online PnP PowerShell module needs to be pre-installed on the machine.
Launch, SharePoint Online Management Shell and, run the below cmdlet.
Connect-PnPOnline -url "SITE URL" Set-PnPPropertyBagValue -Key "BING_MAPS_KEY" -Value "Your Bing API Keys"
If scripting is disabled on the given site then, you might receive a NoScript enabled error. You can check out the workaround to this issue here.
Set the Bing Maps key at the farm level
Again, launch the SharePoint Online Management Shell and run the following cmdlet.
Connect-SPOService -Url <TenantAdminUrl> Set-SPBingMapsKey -BingKey "Your Bing API Keys"
Once, we have set the key, we can start previewing the Geolocation data in actual Bing Maps.