The 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. A map will display pins for up to 1,000 records.
Note:
There is a new administrative wizard for building your map. This interface is accessible from your CONTENTdm 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.
Your map is defined by a snippet of HTML code, which can be placed into any page of your CONTENTdm website that support HTML customization. This includes the home page, any collection landing page, the site About page, and any fully custom page.
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.
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.
Stock HTML snippet generated by the map administrative wizard:
<cdm-map query="/digital/api/map/collection/p20500coll1/search/order/title/ad/asc?metadataField1=title& metadataField2=subjec&metadataField3=descri&latitudeField=publis&longitudeField=creato" center="0,0" zoom="0"> </cdm-map>
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 add a <style> tag before the <cdm-map> element. In order to preserve the responsive behavior of the map, we do not recommend specifying the width of the map, but you can specify a custom height value.
For example, add the following before the <cdm-map> snippet:
<style><!-- cdm-map { height: 400px; } --></style>
The resulting HTML snippet with a custom height value should look like the below:
<style><!-- cdm-map { height: 400px; } --></style> <cdm-map query="/digital/api/map/collection/p20500coll1/search/order/title/ad/asc?metadataField1=title& metadataField2=subjec&metadataField3=descri&latitudeField=publis&longitudeField=creato" center="0,0" zoom="0"> </cdm-map>
You can also add other CSS rules, such as a solid border and a margin to push down the browse button:
<style><!-- cdm-map { height: 400px; border: solid; margin-bottom: 10px; } --></style>