Export (0) Print
Expand All

Use the location field type in mobile applications for SharePoint 2013

SharePoint 2013
 

Applies to: SharePoint Server 2013, SharePoint Foundation 2013

Topic Last Modified: 2012-10-08

Summary: Learn how to work with the new SharePoint 2013 location field type for mobile application development.

SharePoint Server 2013 introduces a new geolocation field type that can be used in a list. For example, you can now make lists “location-aware” and display latitude and longitude coordinates through Bing Maps. An entry is typically seen as a pushpin on the map view. Although there are several ways to use this geolocation field, one key scenario is for mobile application development. Users can track or log location-specific data while they work remotely from the corporate office. Or, the application can help users locate points of interest when they perform offsite functions. To display map views in the list, you must use the Bing Maps service.

The geolocation field is not available when you create a list through the user interface (UI). Therefore, you cannot make a custom list and add it as a column through traditional UI methods. Instead, this field must be inserted programmatically. This article does not explain how to render the geolocation field, or provide developer guidance for creating a location-based mobile application. It provides instruction for displaying map views by using Bing Maps. For information about how to render and work with this data type programmatically, see Integrating location and map functionality in SharePoint 2013.

There is an msi package named SQLSysClrTypes.msi that must be installed on every SharePoint front-end web server to view the geolocation field value or data in a list. This package is responsible for installing the components for implementing the new geometry, geography, and hierarchyid types in SQL Server 2008. By default, this file is installed for SharePoint Online. However, it is not for an on-premises deployment of SharePoint Server 2013. You must be a member of the Farm Administrators group to perform this operation. To download SQLSysClrTypes.msi, see Microsoft SQL Server 2008 R2 SP1 Feature Pack for SQL Server 2008, or Microsoft SQL Server 2012 Feature Pack for SQL Server 2012 in the Microsoft Download Center.

In this article:

You must register with Bing Maps to view location-based data that uses the geolocation field. You need to create a developer account, and create a key for authentication to Bing Maps. If you do not register and apply the key, you will receive an error message when you view map data on the control. To register, see Bing Maps.

The Bing Maps key can be applied to the farm level, website level, or application level. The following table provides the Windows PowerShell for SharePoint Server 2013 cmdlets that are available for configuring Bing Maps.

Table: Windows PowerShell cmdlets for configuring Bing Maps

Cmdlet Description Usage example

Set-SPBingMapsKey

Allows you to set the Bing Maps key to the farm level.

Set-SPBingMapsKey –BingKey < Your Bing Maps Key>

Get-SPBingMapsKey

Retrieves the Bing Maps key.

Get-SPBingMapsKey

Set-SPBingMapsBlock

Specifies whether to block Bing Maps in all locales, or not to block them in all locales. Bing Maps will be displayed in non-restricted locales if this property is not set. The default value is 0 (not blocked). Use a value of 1 to block in all locales.

Set-SPBingMapsBlock1

Get-SPBingMapsBlock

Returns true or false on whether Bing Maps are blocked in all locales. This cmdlet will return an object, and “BlockBingMaps” property will return True or False.

Get-SPBingMapsBlock

 

Use this procedure to apply the Bing Maps key at the farm level. Also, this procedure includes a verification step to ensure the key was applied.

To apply the Bing Maps key at the farm level
  1. Verify that the user account that is performing this procedure has the necessary permissions to use SharePoint Server 2013 cmdlets.

    ImportantImportant:
    To run a Windows PowerShell for SharePoint Server 2013 cmdlet:
    1. Verify that you are a member of the following security roles or groups:

      • securityadmin fixed server role on the SQL Server instance.

      • db_owner fixed database role on all databases that are to be updated.

      • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

      • Add memberships that are required beyond the minimums above.

    2. An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server 2013 cmdlets.

    For more information about SharePoint cmdlet permissions, see “Permissions” in SharePoint 2010 Products administration by using Windows PowerShell in the Search Server 2010 Technical Library.
  2. Start SharePoint 2013 Central Administration.

    • For Windows Server 2008 R2:

      • Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Central Administration.

        If SharePoint 2013 Central Administration is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. To apply the Bing Maps key, at the Windows PowerShell command prompt, type the following command:

    Set-SPBingMapsKey -BingKey <Bing Maps Key>
    

    Where <Bing Maps Key> is the Bing Maps key you received after registering with Bing Maps.

  4. To verify the key was applied, at the Windows PowerShell command prompt, type the following command:

    Get-SPBingMapsKey
    

Use this procedure to apply the Bing Maps key at the website level.

To apply the Bing Maps key at the website level
  1. Verify that the user account that is performing this procedure has the necessary permissions to use SharePoint Server 2013 cmdlets as explained in step 1 in the previous section.

  2. On the Start menu, click All Programs.

  3. Click Microsoft SharePoint 2013 Products.

  4. Click SharePoint 2013 Management Shell.

  5. To apply the Bing Maps key, at the Windows PowerShell command prompt, enter the following code:

    $ServerName = "<SharePoint Server>"
    $site = new-object Microsoft.SharePoint.SPSite($ServerName)
    $web = $site.rootweb
    $web.AllProperties["BING_MAPS_KEY"] = "<Your Bing Maps key>"
    $web.Update()
    

    Where:

    • <SharePoint Server> is the name of the computer that is running SharePoint Server 2013.

    • <Your Bing Maps key> is the Bing Maps key that you receive after you register with Bing Maps.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft