Geolocation field in SharePoint 2013

In this article I’ll show what this field does, a sample of creating and using the field, getting and setting the Bing Maps keys to make sure our maps are properly working and displaying.

What are the location and map features in SharePoint 2013?

SharePoint 2013 introduces a new field type named Geolocation that enables you to annotate SharePoint lists with location information. In columns of type Geolocation, you can enter location information as a pair of latitude and longitude coordinates in decimal degrees or retrieve the coordinates of the user’s current location from the browser if it implements the W3C Geolocation API. In the list, SharePoint 2013 displays the location on a map powered by Bing Maps.
Create a plan list called Location

The same list, with the Geolocation field added to it

When we’ve added the Geolocation field to support our Bing Maps, you can see that a new column is displayed in the list view and you can interact with it. In my sample here I’ve filled in the coordinates for the four office locations  I’ve listed in my list.


Pressing the small globe icon will bring up a nice hover card kind of dialog with the actual map.
Viewing an actual list item looks like this, with the map fully integrated by default into the display form
when edit the item it looks like this. in this you have to mention location. you need to specify you location by longitude and latitude. and also you can use “use my location”  option but your browser should supports the usage and tracking of your location.

now enter your longitude and latitude.


Adding a Geolocation Field to your list

let’s move on to the actually adding the field to our list.  you can definitely add it using code and scripts, which is my preferred way to add stuff anyway.

Adding a Geolocation field using PowerShell

Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = Get-SPWeb ""
$list = $web.Lists["Stores Location"]
$list.Fields.AddFieldAsXml("<Field Type='Geolocation' DisplayName='Office Location'/>",$true,

Adding a Geolocation field using the .NET Client Object Model

function AddGeolocationFieldSample()
var clientContext = new SP.ClientContext();
var targetList = clientContext.get_web().get_lists().getByTitle('Scandinavian Microsoft Offices');
fields = targetList.get_fields();
fields.addFieldAsXml("<Field Type='Geolocation' DisplayName='Office Location'/>",true,SP.AddFieldOptions.addToDefaultContentType)
clientContext.executeQueryAsync(Function.createDelegate(this, this.onContextQuerySuccess), Function.createDelegate(this, this.onContextQueryFailure));

Using Server Object Model:
SPWeb web = site.RootWeb;
SPList list = web.Lists.TryGetList("Stores Location");
if(list != null)
{list.Fields.AddFieldAsXml("<Field Type='Geolocation' DisplayName='Office Location'/>",true,SPAddFieldOptions.AddFieldToDefaultView);}

Bing Maps – getting and setting the credentials in SharePoint.

after field creation you need to set bing maps credential other wise you will face issue on your map. as you can see the issue in picture.

Get your Bing Maps keys

If you don’t have any credentials for Bing Maps, you can easily fetch them by going to the specified Url ( and follow these few simple steps.
you will have to enter some information to create a new key and then click ‘Submit’
After you’ve clicked ‘Submit’ you’ll be presented with a list of your keys, looking something like this.
Great you have done now. Now we need to let SharePoint know about this as well!
we have a Property Bag on the SPWeb object called “BING_MAPS_KEY” which allows us to configure our key.

Setting the BING MAPS KEY using PowerShell on the Farm

Set-SPBingMapsKey -BingKey "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG"

Setting the BING MAPS KEY using PowerShell on a specific Web

Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = Get-SPWeb "http://url"
$web.AllProperties["BING_MAPS_KEY"] = "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG"
Also you can create MAP View from create views.  And now browse your list and add new item as a location……
Hope this Help 🙂 😉
Happy SharePointing