Archive 1.x:Setting Markers on WebMaps

Introduction
If your OSF Web Service network is geo-enabled, and some of the information indexed in the system is geo-located, it means that you will probably present some record information on a map. You basically have three kind of records that get displayed on a map:


 * 1) Records that can be pin-pointed on the map (using a marker)
 * 2) Records that can be outlined on the map (using a polygon shape)
 * 3) Records that represent paths or routes on the map (using a polyline).

This document only deals with the first case. It explains how you can setup the system to display different marker images for the records that can be pin-pointed on a map. The map tool that is generally used is the sWebMap semantic component. This tool displays the records' position on the map, using some marker images, depending on the type of the record to display. The link between the marker image and the record's type is defined in an ontology, and then loaded into the system. Follow the steps below to see how this can be done.

Finding the Record Type
The first step is to check what is the type of the record for which you want to change its marker image. You could know the type of the record because you are the one that created the dataset of these records. However, if you don't know the type of the record you want to setup, you will have to find it.

The easiest way is by using the sWebMap tool. If you are logged in as an administrator, and that you are browsing and searching using the tool, then you will eventually get a list of records that get displayed on the map. You will see an edit icon (typically ) at the right of each record. If you click on the icon, you will get a popup-window that will give you some descriptions of the record. What interests us is the line with this information:

http_--www-w3-org-1999-02-22-rdf-syntax-ns-type = http://purl.org/ontology/now#Cove This means that the type of that record is a.

Finding the Image to Use as a Marker
The next step is to find a good image to use as a marker for the record you want to display on the map.

You can easily do this by looking at a good source of free map markers icons such as the Map Icons collection by Nicolas Mollet and its community. You may also want to review Open Source Icons.

Customizing Markers
If you do chose the Map Icons collection, you can also customize your markers by color and outline type. To do so, do the following:


 * 1) Go to the Map Icons site
 * 2) From the site main menu, pick Marker categories > Your desired category
 * 3) When your desired category icons appear, then pick Icons (upper left button)
 * 4) Then, at the bottom of the page that next appears, enter the new color (via RGB value) you desire in the 'Generate icons with a custom color' utility
 * 5) Enter Generate
 * 6) Then, download the zip file with your new icons and colors.

Note, you can also change the outline/presentation Styles as well for these icons.

Finding the Description of the Type in the Ontology
The next step is to find the description of the type you just found, in the ontology loaded in your instance. For this, you have to go to the structOntology page, and start searching (using the search engine options) or browser them. (For instructions on how to do so, see further the Individual OSF-Drupal Ontology (structOntology) Tool manual.)

Once you found that class description in one of your loaded ontologies, you will have to click on it to see its description. Then you will have to click the "Advanced" bar to extends the content of that section.

Notice the row where it is written: "Map marker image URL:" This is where you have to put the URL of the image that you want to use as a marker.

Once you put the URL in that text field, you simply have to click the "Save" button to save the description of that class, and the modifications you just did on it.

You will perform these 3 steps until you are done setuping your icons.

What if You Can't Find Your Type
If you can't find the type of the record you want to setup, then this may mean:


 * 1) That the ontology used to describe that record is not loaded in your instance
 * 2) That the class as not yet been created.

So, this may need that you will have to load a new ontology into the portal, or that you will have to create a new class into an ontology that is already loaded in your portal. If you have to create a new class, see further Adding an Ontology Concept using structOntology.

Generating the Different Ontological Structures
Once you are done updating the ontology to setup all the icons, you have to recreate the different ontological structures that are used by the Semantic Components so that these new icons get taken into account by the different map-related components. To recreate these structures, you have to go on the main structOntology page, where it lists all the loaded ontologies of the instance. Then, you have to click the "Update" button. If you have numerous big ontologies, it may take several minutes to update. Just be patient. If you close your browser during that process, it will finish anyway, but you won't be notified when it completes.

Check Results
Once the structures used by the sWebMap component are re-generated, you can check the results of your hard work by browsing for the things that you just skinned.

Save Results
The last thing you want to do is to save all the modifications you did in your ontologies on the file system of the server.

First, go to the main structOntology page where all the ontologies get listed. Beside each ontology that you changed, you will see this mention: (modified; not saved). To save your work on the file system, you will have to:
 * 1) Select the radio button at the left of that ontology
 * 2) Click the Save button.

Once you have gotten notification that the ontology is saved (which also removes the (modified; not saved) notation), your changes have now been safely saved.