Build a Map Repository in SharePoint – Part 2
In the first article of this series, I described how the idea of a SharePoint Map Repository came about and how I used Google Maps to create custom maps for tracking my training runs with my 7 year old son. In this segment, I’ll document how I created a basic respository to hold the maps. Then, in the next installment, I’ll demonstrate how to integrate the SharePoint Map Repository into a training tracker in SharePoint.
First Iteration
As I build solutions in SharePoint, I usually start as simple as possible. In this case, I created a Blank Team Site. I then inserted a Content Editor Web Part on the entrance page so that I could cut and paste the Google Map code into the page.
After removing the Microsoft SharePoint Services image from the page, it looked like this:
This is fine except for two things. If someone comes to the site and sees “Content Editor Web Part” as a big headline on the page, that could be confusing. We’ll have to get rid of that, by expanding the “Appearance” marker in the web part Tool Pane and changing it to “Route: World Trade Center Ferry Terminal”.
The main thing, however, is our proof of concept has worked: we can embed Google Map code into a CEWP and it will display nicely in a SharePoint page. What we need to do is to make this solution a little more robust and managable so we don’t have to keep making changes to the source of the web part if we want to update the route.
Management of Google Map Code
Content Editor Web Parts have a feature called “Content Link”, located right below the editing buttons in the Tool Pane.
The purpose of the Content Link is to give you the ability to store content in a text file somewhere else on the site and then point to that file. The ramifications of this ability are huge. That means we can build a library of text files, each with a different running route, and then point to each route as it is needed!
I created a document library called “Training Routes”, put the Google Map code into a simple text file and uploaded it to the library. I then deleted the content in the Source Editor of the CEWP, and “pointed” to that file using the Content Link field. To the End User, this transparent because they don’t know where the content comes from anyway. To the person maintaining multiple routes, it makes it possible to have a library of routes available for the asking.
Enhancements to the Metadata Structure
To make the maps really useful, I need to add a few columns to the library structure so that each map “knows” what it is. The fields needed include:
- Location – City (Single line of text)
- Distance in Miles (Number)
- Distance in Kilometers (Calculated)
- Difficulty of Terrain (Choice)
I could do this by just dumping in one-off columns, but the best way to manage metadata content in SharePoint is through the use of Content Types.
I created each of the columns as site columns and then wrapped them in a Content Types called “Training Route – Base”. This will be the Mother-of-All training route Content Types if I choose to create different training types in the future, attach customized workflow or supply a specific document template. In this case, I created one child called “New Route”, using the custom base Content Type with no other enhancements.
It’s beyond the discussion in this article to do a walk-through of creating content types and associating them with a list or library. You can find that in the 20 module, “The Beginner’s Guide to Content Types” video.
Now when I add new routes, the core information about that route is included as part of the upload.
Summary
By setting up the library this way, I can now use the TrainingRoutes library as a look up table. A logical extension to the project is to create a Training Tracker, a system for tracking and monitoring my exercise schedule. That’s what we’ll look at next in Part 3 of Build a Map Repository in SharePoint.
- Build a Map Repository in SharePoint - Part 1
- Build a Map Repository in SharePoint - Part 2