Skip to main content
OCLC Support

Display items on clickable maps

Overview

The responsive Website Configuration Tool supports creation and display of maps with pins corresponding to the location of records in your collections. This is a good way to give geographic context to your data and present your collections in a visually appealing way.

Placing the pins on the map requires that the records contain latitude and longitude values in two separate metadata fields. Through the Website Configuration Tool you can place maps on your home page, on collection landing pages, on your site’s about page, or on any fully custom pages you have created.

The set of records to display on the map is defined by a search query (or a browse). At this time, the query used for a map must contain records from only a single collection. This is to avoid conflicts with Dublin Core field mapping across different collections. You can create as many maps as you want, so could create one for each collection that contains the necessary geographic metadata.

The map you configure will display inline on the page you choose. The map pins will render dynamically whenever the page is viewed. This means that your query will pull in additional records as you add them to the collection in the future . Note that records that lack valid latitude or longitude data will be ignored when the map is generated. A map will display pins for up to 1,000 records.

The process

Step 1: Define the map

There is a new administrative wizard for building your map. This interface is accessible from your CONTENTdm responsive website. To be able to use this administrative UI, your user account must have the server right to access the Website Configuration Tool as specified in CONTENTdm Administration.

A. Sign in your responsive CONTENTdm website.

B. Run a search or browse to define the set of records you want to display on a map.

C. On the results page, you should see a Generate Map button above your results.

D. Click Generate Map to activate the admin wizard.

E. The admin wizard asks you to specify which metadata fields you want to display in the previews that pop up when a map pin is selected by an end user. The pin popup window will display the record thumbnail and the three metadata fields you choose.

F. You will also need to specify the two metadata fields that contain the latitude and longitude data in your collection. The values in the latitude and longitude fields will define the placement of the record’s pin on the map. Note that latitude and longitude data must be in decimal format for it to be parsed correctly by the map widget. If your geographic data contains degree symbols or other non-standard characters or notation, it is unlikely to be interpreted correctly.

G. After choosing the fields, click the Get HTML button. This will generate the HTML snippet that you will need to use in the Website Configuration Tool.

H. Copy the HTML to your clipboard, and then proceed to step 2.

Step 2: Place the map in the Website Configuration Tool

Your map is defined by a snippet of HTML code, which can be placed into any page of your CONTENTdm responsive website that support HTML customization. This includes the home page, any collection landing page, the site About page, and any fully custom page.

A. Sign in the Website Configuration Tool.

B. Using the Website Configuration Tool menus, navigate to the page where you want to place the map.

C. In the web editor for the page in question, paste the HTML code you copied from the map wizard in Step 1. This HTML snippet can be treated like any other content you have created in the web editor. Be sure to move the code as a single block if you would like to arrange it with other HTML content on your landing page or other custom pages . It might be easier to place the map through the HTML source code editor dialog, the HTML button at the far right of the web editor toolbar.

D. Once you like the placement of your map, click Save and Publish in the Website Configuration Tool to activate your changes.

Note that the map will not render within the Website Configuration Tool. You will only be able to preview the map on your website.

After you have published your map and return to the Website Configuration Tool there will be a graphic icon representing your map. If you want to modify or remove the map you can delete the icon or open the HTML source editor, and then modify the HTML code.

Step 3: Preview and refine the map

You can preview your maps in the same way that you do any change you make in the Website Configuration Tool using the built-in Preview function. This allows you to see how your map looks on different sizes of screens and on mobile devices.

By default, the map will be sized to fit the full width of the content section of the page and will be given a height of 200px. If you would like to adjust these sizes, you can modify the HTML snippet. In order to preserve the responsive behavior of the map we do not recommend that you change the width of the map from 100%, but you can specify custom width values.

To increase the height of the map you simply need to add an inline style statement to the HTML snippet, for example:

style="height: 400px;"

The following examples are a default map HTML snippet and one that has been modified with a custom height.

Stock HTML snippet generated by the map administrative wizard:

<cdm-map
query="/digital/api/map/collection/p20500coll1/search/order/title/ad/asc?metadataField1=title&amp;
metadataField2=subjec&amp;metadataField3=descri&amp;latitudeField=publis&amp;longitudeField=creato" center="0,0" zoom="0">
</cdm-map>

HTML snippet with a custom height value:

<cdm-map
query="/digital/api/map/collection/p20500coll1/search/order/title/ad/asc?metadataField1=title&amp;
metadataField2=subjec&amp;metadataField3=descri&amp;latitudeField=publis&amp;longitudeField=creato"
style=”height: 400px;”
center="0,0" zoom="0">
</cdm-map>

 

  • Was this article helpful?