menu
sluiten
terug naar overzicht

12/02/16

insight

Microsoft Samenwerken

Gerben Ankone

+31 35 539 09 09


12/02/16

Quick & Easy SharePoint Maps: a hidden gem

SharePoint is great at storing data in lists, including locations. But plain lists can be boring, right? So how about getting SharePoint to make it look appealing, without much effort even, wouldn’t that be great?

A little while ago we were asked to move a map with marked locations from an existing site to SharePoint Online. Unfortunately, the code was incompatible with SharePoint. Getting it to work would involve reverse engineering the (minified) JavaScript. However, it was important to get the map working quickly. It was time to explore other options and we found what I consider a little hidden gem in SharePoint: the Geolocation field type! Once aware of the fact that “SharePoint Geolocation” is the magic search combination, lots of information is available on this subject already, like this blog by Tobias Zimmergren, which explains the feature, prerequisites and steps for adding a Geolocation field and a Map view very well, among other things. MSDN is also a great resource (https://msdn.microsoft.com/en-us/library/office/jj163135.aspx) so I won’t go into the details for setting it up. In short, the steps are as follows:

  • Add a field of type Geolocation using code
  • Create a Map view
  • Get a Bing Maps Key
  • Register the Bing Maps key using the Property Bag

The result looks like the following:

quick-and-easy-sharepoint-maps-a-hidden-gem-blog-gerben-01

The default behavior comes with some nice features. The starting position of the map is centered on the locations in the list. You can pan and zoom the map just like on Bing Maps, street view included! After moving the map around a bit, clicking a pushpin in the list will center the map on that location. Last but not least, information in other list columns will also appear on the map, allowing you to show the information you want on the map. Not bad for something you can set up within an hour!

quick-and-easy-sharepoint-maps-a-hidden-gem-blog-gerben-02

People responded very enthusiastically to the map. But there is always room for improvement and some great ideas came up. Some of them are very common for maps, such as drawing regions, clustering the pushpins when zooming out, changing the starting location and/or zoom level, and some more. Some other ideas were specific to SharePoint, these ideas included hiding the column titles above the map, hiding the text in the list area of the view and improving the way locations are added to the list. Adding locations is currently done by entering latitude and longitude, which takes some time and effort. Many other ideas were mentioned as well. In most cases it is not adjustable by default and in some cases adding a little JavaScript and CSS can go a long way. I consider the Geolocation Field a hidden gem for adding a nice map (very!) quickly. Getting it cut and polished to look exactly like you want, however, is a different story. This may take a fair amount of digging around in the existing code. Which is definitely something I will be doing.

Delen

Meer weten over dit onderwerp?

Neem contact op met Gerben Ankone
gang van het kantoor, vx company