Configuration Information

Configuration Information

The portlet has one property file: configuration.properties and one map file: map.json

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

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

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

 

Maps Portlet extension and integration

Technical implementation details