Attribute settings: Geocode

From CollectiveAccess Documentation
Jump to: navigation, search

[Valid for v1.6]

Geocode attribute type notes

The Geocode attribute type represents one or more coordinates (latitude/longitude pairs) indicating the location of an item (collection object, geographic place, storage location or whatever else you want to place on a map).

Coordinates can be entered as decimal latitude/longitude pairs (ex. 40.321,-74.55) or in degrees-minutes-seconds format (ex. 40° 23' 10N, 74° 30' 5W). Multiple latitude/longitude coordinates should be separated with semicolons (";"). UTM format coordinates is also supported.

Non-coordinate entries are converted to coordinates using the Google Maps Geocoding service, which works well for most full and partial addresses worldwide. To unambiguously distinguish coordinate data from address data to be geocoded, it is strongly suggested that coordinate lists be enclosed in square brackets (ex. [40.321,-74.55; 41.321,-74.55;41.321,-75.55;40.321,-75.55;40.321,-74.55].

Google Maps integration

The Google Maps mapping service is used to produce maps displaying your coordinates. The Geocode attribute used to support either version 2 or 3 of the Google Maps API, selectable via the google_api directive in the global.conf file. As of August 2010, only the v3 API is supported since v2 is now officially deprecated by Google. Any old v2 configuration in your installation (assuming you installed prior to August 2010) will be ignored.

Adding rectified overlays

You can add layers that include rectified maps by creating serve-able tiles using a tool such as [MapWarper http://mapwarper.net] and the Google/OSM URL it provides as an export option. The OSM URL will be in the format http://mapwarper.net/maps/tile/0001/z/x/y.png. You will need to change the x, y and z placeholders in ${x}, ${y} and ${z} respectively. The example OSM URL for CollectiveAccess would be http://mapwarper.net/maps/tile/3671/${z}/${x}/${y}.png. This URL should be entered into the "Tile Server URL" option for the metadata element. You should also provide a layer name describing the content of the map. If you wish to allow users to toggle the layer on and off check the "Show layer switcher controls" checkbox.

The list (array) of attribute settings can be viewed in the application code at https://github.com/collectiveaccess/providence/blob/master/app/lib/ca/Attributes/Values/GeocodeAttributeValue.php.


Settings Description Default Values
fieldWidth Width, in characters, of the field when displayed in a user interface. 70 Integers greater than zero
fieldHeight Height, in characters, of the field when displayed in a user interface. 2 Integers greater than zero
mustNotBeBlank Use this option if this attribute value must be set to some value - if, in other words, it must not be blank. 0 (can be blank) 0 or 1
doesNotTakeLocale Defines whether element takes locale specification. 1 (does not take locale specifications) 0 or 1
canBeUsedInSort Use this option if this attribute value can be used for sorting of search results. 0 (not used in sort) 0 or 1
canBeUsedInSearchForm Use this option if the attribute value can be used in search forms. 1 (used in search forms) 0 or 1
canBeUsedInDisplay Use this option if the attribute value can be used for display in search results. 1 (used for display) 0 or 1
displayTemplate Layout for value when used in a display. Element code tags prefixed with the ^ character, used to represent the value in the template. For example: <i>^my_element_code</i>. HTML
tileServerURL OSM URL for tileserver to load custom tiles from, with placeholders for X, Y and Z values in the format ${x}. . http://mapwarper.net/maps/tile/3671/${z}/${x}/${y}.png URL with placeholders
tileLayerName Display name for layer containing tiles loaded from tile server specified in the tile server URL setting. 1929 Street Atlas Text
layerSwitcherControl Include layer switching controls in the map interface. 1 (show controls) 0 or 1
canMakePDF Check this option if this metadata element can be output as a printable PDF. (The default is not to be.) 0 0 or 1
CanMakePDFForValue Check this option if individual values for this metadata element can be output as a printable PDF. (The default is not to be.) 0 0 or 1

by_hand_sphinx

Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools