SharePoint 2013 Preview 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. For more information about the Geolocation field, see Integrating location and map functionality in SharePoint 2013.
What about another Map providers, let’s take a look on how to implement geolocation field that renders Google Maps.
First of all we need to create custom Geolocation field, for details see How to: Create a custom Geolocation field that renders using Nokia Maps.
Here we will only implement Geolocation field template for Google Maps, all the remaining steps the same as described in How to: Create a custom Geolocation field that renders using Nokia Maps. This is client side rendering template file that JSLink method of the field class points to, for more information see How to: Customize a field type using client-side rendering
Below is presented GMapsGeolocatioFieldTemplate.js rendering template for Google Maps.
SharePoint 2013 project with implementation of custom geolocation field that renders Google Maps may be found here.
- Creating Google Maps Geolocation column
- List view with Google Maps Geolocation column
- Create or edit form with Google Maps Geolocation column
For searching locations on Edit form is used Google Geocoding API.
- Source code for Geolocation field that renders using Google Maps is hosted on GitHub
- How to: Create a custom Geolocation field that renders using Nokia Maps
- How to: Customize a field type using client-side rendering
- Google Geocoding API