With SharePoint 2013 and Bing maps, there’s the added ability to include location information in your lists. So how do we add this functionality?
To enable the Geo-location column in SharePoint 2013, you need to install the file “SQLSysClrTypes.msi” which is a free download from Microsoft. This is a straight forward installation without configuration options so just run with the defaults.
The file can be downloaded from the following locations depending on your environment
SQL Server 2012 SP1 Feature Pack
SQL Server 2008 R2 SP1 Feature Pack
SQL Server 2008 R2 SP2 Feature Pack
This needs to be installed on all web servers in your farm.
Next head over to the Bing Maps Portal to get your key. You’ll need a Windows Live ID to sign in, which can be created at the site if you don’t already have one.
Once signed in, click on “Create or view keys” in the “My Account” section and fill in the necessary details to create your key. You’ll need to specify an “Application Name“, “Key Type” & “Application Type” as well as verify a CAPTCHA image.
Trial Keys are valid for 90 days and are limited to 10,000 transactions in any 30 day period.
Basic Keys are valid for applications which do not exceed 50,000 transactions in a 24 hour period.
Full details and the available application types can be found here.
Once your key is generated in copy the key and head back to a web server in your farm, we need to run the “Set-SPBingMapsKey” command from a PowerShell console with Administrator access and as below
Set-SPBingMapsKey –BingKey “<your_copied_bing_Key>”
Next we need to enable the column so it can be added to your list, this again is done via PowerShell replacing “<web_url>” with the full url of your web application.
$fieldxml = "<Field Type='Geolocation' DisplayName='Geo Location' />"
$web = Get-SPWeb <web_url>
$fieldName = $web.Fields.AddFieldAsXml($fieldxml)
There is already a default site column called “Location” so choose a different name otherwise this will be replaced. In the example above I’ve chosen to call my column “Geo Location“.
Now, from “List Settings” on any of your lists, you can select “Add from existing site columns” and under “Custom Columns” you’ll see your new column ready to add.
To add the location to your list, you’ll need to grab the Longitude and Latitude for your chosen location, this is done by right-clicking Bing maps at the point of address and copying the 2 figures.
Adding the position to your column is as simple as clicking “Specify Location” and adding the previously captured Longitude & Latitude into the pop-up dialog box.