Configuration Information
The portlet has one property file: configuration.properties and one map file: map.json
- Check out project from https://github.com/Jasig/MapPortlet
- Configure src/main/resources/configuration.properties
- Run "mvn install".
- Deploy the war.
Configuration, customization, and administration
- 1.0.0-M4+: map URL protocol is dynamic (https if needed), map URL can be relative (e.g. /data/map.json) and prefix constructed accordingly
- 1.0.0-M3+: Default starting map location (latitude and longitude) are obtained from (in order of priority):Â portlet preference, json data file, else default value.
- 1.0.0-M2 and before:Â Default starting map location (latitude and longitude) are obtained from (in order of priority):Â portlet preference, else default value.
src/main/resources/configuration.properties
- If need be, adjust the url to the map file (defaults to http://localhost:8080/MapPortlet/data/map.json)
webapp/data/map.json
- 1.0.0-M3 and later: change the "defaultLocation" geocode for the default location to display when the map is displayed. As an alternate, you can set latitude and longitude portlet preferences.
- Add "locations" geocode data for sites on your campus. You can specify any of the following data elements for each location. See the map.json file in the project for examples:
Field | Description |
---|---|
latitude | latitude of location |
longitude | longitude of location |
name | Name of location. Displayed to user and available in searches |
abbreviation | Abbreviation of location. Displayed to user and available in searches |
address | Postal address of location |
description | Description to display to users when location is selected |
img | URL of image to display to user |
searchText | Do not specify. Field is constructed from name and abbreviation |
searchKeys | List of additional strings included in user searches |
categories | List of categories for 'Browse by category' function. |
campuses | Â |
- NOTE:Â The json file is cached by the portlet for 2 minutes, and on the client browser for 6 minutes (by default) so changes to the json file will reflect in subsequent requests after that.
portlet preferences
You can specify the following portlet preferences to override default values when you create a portlet in the portal:
Preference Name | Default | Description |
---|---|---|
apiKey | Â | API key to use for Google Maps |
latitude | 41.300937 | Latitude to display for initial map view |
longitude | -72.932103 | Longitude to display for initial map view |
zoom | 17 | Â |
mapTypeControl | true | Â |
panControl | false | Â |
zoomControl | true | Â |
streetView | true | Â |
scaleControl | true | Â |
rotateControl | false | Â |
overviewControl | false | Â |