Skip to content

sc-selected-asset

sc-selected-asset-field-Example-1-Image-2

1 Purpose

sc-selected-asset places a combined address search, street address, primary assets, secondary assets and map field on a form. The map uses icons (e.g. points, lines, polygons or images) to show the geospatial location of the documents returned by a filter query. Tooltip text can be configured to display on mouseover of a marker. Map buttons provide the ability to zoom in, zoom out, centre on current location, toggle full screen, select primary assets, select secondary assets and toggle map views.

The sc-selected-asset definition provides fields for setting the properties of a selected asset field and is fully described below.

 

2 Definition

sc-selected-asset is defined by a set of name/value pair fields consisting of:

  • Required system fields
  • Required customizable fields
  • Optional customizable fields

Note:

  1. Default values for fields described in the tables below are shown in bold text.

2.1 Root Level Fields

This section describes the root level fields of the sc-selected-asset definition.

2.1.1 Required System Fields

Field Valid Values Description
componentName sc-selected-asset The component name.
Example: "componentName": "sc-selected-asset"

2.1.2 Required Customizable Fields

Field Valid Values Description
layers Array of map layer definitions An array of map layer definitions, each defining the properties of a map layer. Each map layer definition is a set of name/value pair fields, some being required, some being optional.
Section 2.4 layers Field lists and describes the fields for defining the properties of a map layer.
mapParameters Set of name/value fields A set of name/value fields defining the properties of the map.
Section 2.2 mapParameters Field lists and describes the name/value fields for defining the properties of the map.
name Any value written in camel case. Defines the name of the selected asset field in the document and database.
Example: "name": "testScSelectedAsset"

2.1.3 Optional Customizable Fields

Field Valid Values Description
addressImageAnchor [x,y] The position of the top-left corner of the image used to indicate an address location.
Written as an array [x,y], where x and y can be zero or a positive or a negative decimal number.
The x and y values indicate the position (in image widths and image heights) of the top-left corner of the image relative to the address location.
[0.5,1.0] positions the top-left corner of the image (0.5 x image width) to the right and (1.0 x image height) upwards from the address location.
Example:
"addressImageAnchor": [
    0.5,
    1.0
]
Defaults to:
"addressImageAnchor": [
    0.5,
    1.0
]
addressImageFileNo Image File Number The image used to indicate the location of the address.
Example: "addressImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8"
Defaults to the existing image.
country Valid country code Used by the geocode service to improve its performance. E.g. address searches will restrict results to the defined country.
To avoid conflicts, recommend using either this "country" field or the "geocoderDefaultCountry" field within the "geocodeSearchService" field (see below) to specify a country, but not both.
Example: "country": "au"
Defaults to the "geocoderDefaultCountry" if one exists, otherwise no restriction on country.
delayBeforeCallNum numeric The number of milliseconds before an address search is triggered.
Example: "delayBeforeCallNum": 200
??? Default value.
disableMouseWheel true Disable the ability to zoom the map using the mouse wheel.
Example: "disableMouseWheel": true
false Default value. Enable the ability to zoom the map using the mouse wheel.
disableSave true Entering or selecting an address or an asset does not trigger the Save icon to flash.
Exiting the form without saving the entered value does not trigger a warning message to display.
Example: "disableSave": true
false Default value. Entering or selecting an address or an asset does trigger the Save icon to flash.
Exiting the form without saving the entered value does trigger a warning message to display.
enabled false Disables "Address", "Address Search", "Primary Assets" and "Secondary Assets" fields. Disables "Select Address", "Select Primary Asset" and "Select Secondary Asset" map buttons.
A Stop icon appears on mouseover of the above fields and buttons.
The "Zoom", "Current Location", "Full Screen", "Map View", and "Full Screen" map buttons remain enabled. ??? AND the Current location button allowing the current location to be saved.
??? ISSUE Clicking the "Current Location" should centre and zoom the map on the current location but not select it. Currently it also selects it regardless of the "enabled" true/false setting.
Example: "enabled": false
true Default value. All fields and map buttons are enabled.
EPSG Valid EPSG SRID EPSG is a spatial coordinate system used to locate geographical entities on a map, a map being a 2D projection of the 3D earth's surface or a region of the earth's 3D surface. There are many 2D projections, each using different properties to represent distances, angles or areas. Certain projections are better suited for different regions in the world.
An EPSG SRID (Spatial Reference System Identifier) value identifies a specific 2D projection coordinate system together with the region of the earth it covers. E.g. EPSG:3111 is the projection coordinate system used for rendering map of the state of Victoria (between 140.9500, -39.1500 and 149.9800, -34.0000).
Example: "EPSG": "EPSG:3111"
EPSG:3857 Defaults to the Web Mercator projection (EPSG:3857) which is used to render a map of the world (between 85.06°S and 85.06°N) in Google Maps, OpenStreetMaps, OpenLayers, etc.
fullWidth true The selected asset field displays full width on the form.
Full width is recommended for the selected asset field.
Example: "fullWidth": true
false Default value. The selected asset field does not display full width on the form.
geocodeSearchService A geocode service A geocode service provides geocoding and reverse geocoding functionality.
Geocoding translates a human-readable address (e.g. 260 Elizabeth Street, Melbourne VIC 3000) into geographic coordinates (e.g. latitude -37.81384, longitude 144.963028) which can be used to place markers on a map or position the map.
Reverse geocoding translates geographic coordinates into a human-readable address.
Geocode service providers include Google, Geocode.Farm, Vicmap, PSMA.
To use a geocode service, you need an API key.
A geocode service is specified by a set of pre-defined name/value fields.
The "geocodeSearchService" field is an array with one or more geocode service name/value fields. In the examples below, the geocodeSearchService:
"name" field specifies the geocode service provider e.g. "google".
"apiKey" field specifies your application's API key.
"geocoderDefaultCountry" and "geocoderDefaultState" fields are optional and configurable and are used by the geocode service to improve performance. E.g. address searches will restrict results to the defined country and/or state. To avoid conflicts, recommend using either the "country" field (see above) or this "geocoderDefaultCountry" field within the "geocodeSearchService" field to specify a country, but not both.
Example: Google geocode service
"geocodeSearchService": [
    {
        "name": "google"
        "apiKey": "Insert your Google API Key here",
        "autocompleteUrl": "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=",
        "geocodeUrl": "https://maps.googleapis.com/maps/api/geocode/json?latlng=",
    }
]
Example: Geocode.Farm geocode service:
"geocodeSearchService": [
    {
        "name": "geocodefarm",
        "apiKey": "Insert your Geocode.Farm API Key here",
        "autocompleteUrl": "https://www.geocode.farm/v3/json/forward/?addr=",
        "geocodeUrl": "https://www.geocode.farm/v3/json/reverse/",
        "geocoderDefaultCountry": "Australia"
    }
]
Example: Vicmaps geocode service:
"geocodeSearchService": [
    {
        "name": "vicmap",
        "apiKey": "Insert your Vicmap API Key here",
        "autocompleteUrl": "https://api.maps.vic.gov.au/vicmapapi/map/addressSearch?jsoncallback=?&format=json&addressLine=",
        "geocodeUrl": "https://www.geocode.farm/v3/json/reverse/",
        "geocoderDefaultState": "Victoria",
        "geocoderDefaultCountry": "Australia"
    }
]
Example: PSMA geocode service:
"geocodeSearchService": [
    {
        "name": "psma",
        "apiKey": "Insert your PSMA API Key here",
        "autocompleteUrl": "https://api.psma.com.au/predictive/address?query=",
        "geocodeUrl": "https://api.psma.com.au/beta/v1/addresses?radius=",
        "apiKeyReverse": "Your PSMA Reverse API Key goes here",
        "addressUrl": "https://api.psma.com.au/predictive/address/"
    }
]
Defaults to the Geocode.Farm geocode service.
heightNum numeric Defines the height of the selected asset map field as a multiple of a standard height.
Example: "heightNum": 2
1 Default value. The height of the selected asset map field defaults to 1 standard height.
hideAddress true Hide the selected asset address fields, show only the map and the primary and secondary ssset fields
Example: "hideAddress": true
false Default value. Do not hide selected asset address fields.
initialMapView Defines how to set the initial map area.
map Position the map at the point and zoom level defined by the "mapParameters" defaultLon, defaultLa and zoom fields.
Example: "initialMapView": "map"
all Set the map area to the area covered by the assets returned by the "layers" and "filter" queries.
Example: "initialMapView": "all"
layers Set the map area to the area covered by the assets returned by the "layers" query.
Example: "initialMapView": "layers"
filter Default value. Set the map area to the area covered by the assets returned by the "filter" query.
Example: "initialMapView": "filter"
label Any value Defines the name of the selected asset field on the form i.e. the field label.
Example: "label": " Test sc-selected-asset"
Defaults to no label is displayed.
language A valid language code Used by the geocode service to improve its performance.
Example: "language": "en"
Default value is geocode service dependent. E.g. Google Maps attempts to load the most appropriate language based on the users location or browser settings.
mandatory true The selected asset field displays as mandatory (i.e. label in red text with an asterisk).
Saving without a value, a message prompts the user to enter a value for the selected asset field.
Example: "mandatory": true
false Default value. The field displays as optional (i.e. label in black text).
mandatoryFields Array of fields When "mandatory": true is set, lists which fields will be considered mandatory.
Example:
"mandatoryFields": [
    "streetNo",
    "street",
    "suburb",
    "street",
    "postcode",
    "locationDescription",
]
Defaults to:
"mandatoryFields": [
    "unitNo",
    "streetNo",
    "street",
    "suburb",
    "street",
    "postcode",
    "state",
    "country",
    "locationDescription",
    "coordinates",
    "primaryAsset",
    secondaryAsset
]
noSecondaryAssetSelection true Hide the option to select secondary assets.
Example: "noSecondaryAssetSelection": true
false Default value. Show the option to select secondary assets.
popupAssetSelection true If multiple assets are returned when selecting an asset from the map, the assets are listed as selectable items in a popup menu. Note:
(1) If "singlePrimaryAssetSelection": true, then radio buttons are used to allow a single asset to be selected as the primary asset from the popup menu. Otherwise checkboxes are used to allow multiple assets to be selected as primary assets.
(2) If "noSecondaryAssetSelection": false, then checkboxes are used to allow a multiple assets to be selected as secondary assets from the popup menu. Otherwise the option to select secondary assets is hidden.
(3) To dismiss the popup menu a click outside the menu.
Example: "popupAssetSelection": true
false Default value. Multiple returned assets are not listed as selectable items in a popup menu. Note:
(1) If "singlePrimaryAssetSelection": true, one of the returned assets will be automatically selected as the primary asset. Otherwise all of the returned assets will be automatically selected as primary assets.
(2) If "noSecondaryAssetSelection": false, then all of the returned assets will be automatically selected as secondary assets. Otherwise the option to select secondary assets is hidden.
popupAssetSelectionPrimaryText handlebar syntax Defines the display text for assets when selecting the primary asset(s) in popup menu i.e. this occurs when "popupAssetSelection": true (see above).
Example:
"popupAssetSelectionPrimaryText": "Primary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}"
Default value:
"popupAssetSelectionPrimaryText": "{{{systemHeader.summaryName}}}"
popupAssetSelectionSecondaryText handlebar syntax Defines the display text for assets when selecting the secondary asset(s) in popup menu i.e. this occurs when "popupAssetSelection": true (see above).
Example:
"popupAssetSelectionSecondaryText": "Secondary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}"
Default value:
"popupAssetSelectionSecondaryText": "{{{systemHeader.summaryName}}}"
positionMandatory true Restricts the entry on an address to the address search field, all other address fields being disabled.
Once an address has been selected, the latitude and longitude fields remain disabled but the other address fields are enabled.
Example: "positionMandatory": true
false Default value. All address fields are enabled.
primaryAssetAddressField An asset address field name If "primaryAssetAddressSelection": true, then this field of the selected asset is used to:
- Write the asset address fields of the primary asset.
- Populate the address fields on the form. If a new primary asset is selected then the address fields on the form will be overwritten.
- Position and display an address pin on the map.
Example: "primaryAssetAddressField": "addressGeo"
primaryAssetAddressSelection true Enables the "primaryAssetAddressField". Hence, the "primaryAssetAddressField" will be used to:
- Write the asset address fields of the selected primary asset.
- Populate the address fields on the form.
- Position and display an address pin on the map.
Example: "primaryAssetAddressSelection": true
false Default value. Disables the "primaryAssetAddressField". Hence, the "primaryAssetAddressField" will not used to:
- Write the asset address fields of the selected primary asset.
- Populate the address fields on the form.
- Position and display an address pin on the map.
primaryAssetFilter Elastic search query A query to search for asset documents from which an asset can then be selected as a primary asset.
Allows the user to search for and select an asset based on criteria entered in the primary assets field as an alternative to selecting a primary asset from the map.
Example: "primaryAssetFilter": "{'query':{'bool':{'filter':[]}}}"
Defaults to no search for asset documents is performed.
primaryAssetGeometryField An asset geometry field name This field of the selected asset is used to:
- Write the asset geometry fields of a primary asset. I.e. write the coordinates of the point used to select the asset.
- Position and display an asset pin on the map.
Example: "primaryAssetGeometryField": "locationGeo"
primaryImageAnchor [x,y] The position of the top-left corner of the image used to indicate a primary asset location.
[Written as an array, [x,y] where x and y can be zero or a positive or negative decimal number.
The x and y values indicate the position (in image widths and image heights) of the top-left corner of the image from the primary asset location.
[0.5,1.0] positions the top-left corner of the image (0.5 x image width) to the right and (1.0 x image height) upwards from the primary asset location.
Example:
"primaryImageAnchor": [
    0.5,
    1.0
]
Defaults to:
"primaryImageAnchor": [
    0.5,
    1.0
]
primaryImageFileNo Image File Number The image used to indicate a selected primary asset.
Example: "primaryImageFileNo": "63d53643-65da-4db5-82f5-2af257845516"
Defaults to the existing image.
relatedFields Provides the ability to pass additional data from the linked asset document to the sc-selected-asset document structure.
Set of field name pairings A set of destination and source field pairings. The source field is a linked asset field. The destination field is the sc-selected-asset field for storing the source field value.
Example:
"relatedFields": {
    "assetNumber": "assetNumber",
    "pipe_dia": "pipe_dia",
    "pipe_matr": "pipe_matrl",
    "pipe_type": "pipe_type"
}
Defaults to no additional data is passed from the linked asset document to the sc-selected-asset document structure.
searchDelay 1500 On entering criteria into the address search field, the number of milliseconds to wait until the address search function is called.
500 Defaults to 500 milliseconds.
searchMinLength Numeric value The minimum number of characters that need to be entered into the address search field before the address search function is called.
3 At least 3 characters need to be entered into the address search field before a search will take place.
secondaryAssetFilter Elastic search query A query to search for asset documents from which an asset can then be selected as a secondary asset.
Allows the user to search for and select an asset based on criteria entered in the secondary assets field as an alternative to selecting a secondary asset from the map.
Example:
"secondaryAssetFilter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'54eecc5b2536c225ec734273'}}]}}}"
Example:
"secondaryAssetFilter": "{'query':{'bool':{'filter':[{'term':{ 'wat_category': 'POTABLE'}},{'term':{'systemHeader.systemType':'document'}},{'term':{'pipe_type':'RETMAIN'}}]}}}"
Defaults to no search for asset documents is performed.
secondaryImageAnchor [x,y] The position of the top-left corner of the image used to indicate a secondary asset location.
[Written as an array [x,y], where x and y can be zero or a positive or negative decimal number.
The x and y values indicate the position (in image widths and image heights) of the top-left corner of the image from the secondary asset location.
[0.5,1.0] positions the top-left corner of the image (0.5 x image width) to the right and (1.0 x image height) upwards from the secondary asset location.
Example:
"secondaryImageAnchor": [
    0.5,
    1.0
]
Defaults to:
"secondaryImageAnchor": [
    0.5,
    1.0
]
secondaryImageFileNo Image File Number The image used to indicate a selected secondary asset.
Example: "secondaryImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8"
Defaults to the image of the existing pin.
singlePrimaryAssetSelection true Only one asset can be selected as the primary asset. Each time an asset is selected, only the last selection is recorded.
Example: "singlePrimaryAssetSelection": true
false Default value. Multiple assets can be selected as primary assets.
tooltipsTimeout numeric Defines the number of seconds an asset mouseover tooltip remains visible.
Example: "tooltipsTimeout": 2
Defaults to remains visible until the mouse is moved over another asset.
visible false The selected asset field is not visible on the form.
Example: "visible": false
true Default value. The selected asset field is visible on the form

2.2 mapParameters Field

The "mapParameters" field in Section 2.1.2 Required Customizable Fields is a set of name/value fields defining the properties of the map.

This section lists and describes the name/value fields for defining properties of the map.

2.2.1 Required Customizable Fields

Field Valid Values Description
defaultLat Valid latitude The latitude, written as a decimal, at which to initially centre the map field.
Valid latitude values range from 0 to (+/–)90.
Example: "defaultLat": -37.8034619371937
0 Default value. The map field initially centres at latitude 0, the equator.
defaultLong Valid longitude The longitude, written as a decimal, at which to initially centre the map field.
Valid longitude values range from 0 to (+/–)180.
Example: "defaultLon": 144.89993237404
0 Default value. The map field initially centres at longitude 0, the prime meridian running through Greenwich, England.
mapViews Array of map view definitions An array of map view definitions, each defining the properties of a map view. Each map view definition is a set of name/value pair fields, some being required, some being optional.
Section 2.3 mapViews Field lists and describes the fields for defining the properties of a map view.
maxResolution Decimal number The maximum resolution at which the map will be visible.
Example: "maxResolution": 2116.670900008467
??? Default value.
minResolution Decimal number The minimum resolution at which the map will be visible..
Example: "minResolution": 0.0116670900008467
??? Default value.
zoom Integer The level at which to initially zoom the map field.
Example: "zoom": 10
2 Default value.

2.3 mapViews Field

The "mapViews" field in Section 2.2.1 Required Customizable Fields is an array of map view definitions, each defining the visual parameters (e.g. 2D projection, resolution, zoom level) of a map view.

This section lists and describes the fields for defining the properties of a map view.

2.3.1 Required System Fields

Field Valid Values Description
EPSG Valid EPSG SRID EPSG is a spatial coordinate system used to locate geographical entities on a map, a map being a 2D projection of the 3D earth's surface or a region of the earth's 3D surface. There are many 2D projections, each using different properties to represent distances, angles or areas. Certain projections are better suited for different regions in the world.
An EPSG SRID (Spatial Reference System Identifier) value identifies a specific 2D projection coordinate system together with the region of the earth it covers. E.g. EPSG:3111 is the projection coordinate system used for rendering map of the state of Victoria (between 140.9500, -39.1500 and 149.9800, -34.0000).
Example: "EPSG": "EPSG:3111"
EPSG:3857 Defaults to the Web Mercator projection (EPSG:3857) which is used to render a map of the world (between 85.06°S and 85.06°N) in Google Maps, OpenStreetMaps, OpenLayers, etc.
params Array of map view parameters Array of predefined mapView parameters.
Example:
"params": {
    "LAYERS": "CARTO_WM",
    "VERSION": "1.1.1",
    "FORMAT": "image/png",
    "HEIGHT": "512",
    "WIDTH": "512",
    "BBOX": "16133701.716224,-4393099.8016821,16446787.78408,-4080013.733826",
    "SRS": "EPSG:3857",
    "STYLES": "",
    "REQUEST": "GetMap",
    "SERVICE": "WMS",
    "FIRSTTILE": true
    }
}
Example:
"params": {
    "LAYERS": "AERIAL_WM",
    "VERSION": "1.1.1",
    "FORMAT": "image/png",
    "HEIGHT": "512",
    "WIDTH": "512",
    "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
    "SRS": "EPSG:3857",
    "STYLES": "",
    "REQUEST": "GetMap",
    "SERVICE": "WMS",
    "FIRSTTILE": true
    }
}
serverType Defines the map source.
geoserver An open source server for sharing geospatial data. Used for web base maps such as OpenLayers, Google Maps, etc.
Example: "serverType": "geoserver"
tile A server providing maps as tiles i.e. splitting the map up into images.
Example: "serverType": "tile"
url url address url address to communicate with a map server.
Example: "url": "https://base.maps.vic.gov.au/service"
Example: "url": "https://osm.formbird.com/tiles/{z}/{x}/{y}.png"

2.3.2 Required Customizable Fields

Field Valid Values Description
uiLabel Alpha character Defines the label for a map view button.
Example: "uiLabel": "V"

2.3.3 Optional Customizable Fields

Field Valid Values Description
crossOrigin Used for loaded images. A crossOrigin value is required if using the WebGL renderer or if accessing pixel data from an image server.
It's a way for the webpage to ask the image server for permission to use the image.
User credentials Asks for permission, sending user credentials to the server.
Example: "CrossOrigin" : "jsmith.j53p19f5"
anonymous Asks for permission but don't send extra information.
Example: "crossOrigin": anonymous
null Default value. Do not ask for permission.
Example: "crossOrigin": null
groupView Array of map view definitions Group multiple map views definitions for display purposes.
Example:
"groupView": [
    {
        "params": {
            "LAYERS": "AERIAL_WM",
            "VERSION": "1.1.1",
            "FORMAT": "image/png",
            "HEIGHT": "512",
            "WIDTH": "512",
            "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
            "SRS": "EPSG:3857",
            "STYLES": "",
            "REQUEST": "GetMap",
            "SERVICE": "WMS",
            "FIRSTTILE": true
        }
        "EPSG": "EPSG:3857",
        "url": "https://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms",
        "serverType": "geoserver"
    }
    {
        "params": {
            "LAYERS": "CARTO_OVERLAY_WM",
            "VERSION": "1.1.1",
            "FORMAT": "image/png",
            "HEIGHT": "512",
            "WIDTH": "512",
            "BBOX": "16446787.78408,-4393099.8016821,16759873.851936,-4080013.733826",
            "SRS": "EPSG:3857",
            "STYLES": "",
            "REQUEST": "GetMap",
            "SERVICE": "WMS",
            "FIRSTTILE": true
        }
        "EPSG": "EPSG:3857",
        "url": "https://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms",
        "serverType": "geoserver"
    }
]
isShow true Identifies the initial map view to show on load.
Example: "isShow": true
Defaults to the the first map view of the sc-selected-asset definition.

2.4 layers Field

The "layers" field in Section 2.1.2 Required Customizable Fields is an array of map layer definitions, each defining the properties of a map layer.

This section lists and describes the fields for defining the properties of a map layer.

2.4.1 Required Customizable Fields

Field Valid Values Description
filter Elastic search query A query to return items (e.g. Hydrants) for display in the layer.
Example:
"filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'d62a4970-d88e-11e6-92c9-934eb61df86d'}}],'must':[{'term':{'asset_category':'HYDRANT'}}]}}}"
geoJsonField A geoJson field name The document field that contains its spatial geometry i.e. its type (point, line, polygon, etc) and its coordinates.
The spatial geometry is used to render an item on a map.
Example: "geoJsonField": "locationGeo"

2.4.2 Optional Customizable Fields

Field Valid Values Description
color A valid color The line colour of lines and polygons returned by a layer filter.
Example: "color": "red"
blue Default value.
fill A valid colour The fill colour of polygons returned by a layer filter.
Example: `"fill": "green"``
Defaults to no fill.
fillOpacity Decimal from 0 to 1 The fill opacity of polygons returned by a layer filter.
Example: "fillOpacity": 0.5
1 Default value.
imageAnchor [x,y] The position of the top-left corner of the image used to indicate point items (e.g. Hydrants) returned by a layer filter.
Written as an array [x,y], where x and y can be zero or a positive or negative decimal number.
The x and y values indicate the position (in image widths and image heights) of the top-left corner of the image from the item's location.
[0.5,1.0] positions the top-left corner of the image (0.5 x image width) to the right and (1.0 x image height) upwards from the item's location.
Example:
"imageAnchor": [
    0.5,
    1.0
]
Defaults to:
"imageAnchor": [
    0.5,
    1.0
]
imageFileNo An image file number The image to use to indicate point items (e.g. Hydrants) returned by a layer filter.
Example: "imageFileNo": "62435f30-20fc-11e8-8329-0db8fb5fedc2"
Defaults to the existing image.
layerDisplayOnly true Sets the layer to display only, preventing the selection of items returned by a layer filter.
Example: "layerDisplayOnly": true
false Default value. Allows the selection of items returned by a layer filter.
lineCap The line end style of line and polygons returned by a layer filter.
square Lines ends are square.
Example: "lineCap": "square"
round Default value. Lines ends are rounded.
lineDash [x,y] The line dash pattern of lines and polygons returned by a layer filter.
Defined by an array [x,y] of 2 numbers where x is the dash length, y is the gap length.
Example:
"lineDash": [
    10,
    5
]
Defaults to no dash pattern i.e. a solid line.
lineWidth Decimal number The line width of lines and polygons returned by a layer filter.
Example: "lineWidth": 2
4 Default value.
tooltips handlebar syntax Defines the tooltip text to display on mouseover of an item returned by a layer filter.
Example:
"tooltips": "PIPE <b>{{{systemHeader.summaryName}}}</b> created on {{{systemHeader.createdDate}}}"
Example: This example includes a hyperlink in the tooltip, in this case to open a document.
"tooltips": "tooltips": "<a href='/#/form/{{{documentId}}}' target='_blank'>{{{systemHeader.summaryName}}}</a>"
Defaults to no tooltip text is displayed on mouseover of an item returned by a layer filter.

 

3 Typical sc-selected-asset Definition

Below is a typical sc-selected-asset definition, defined with its required fields plus any optional field whose value is typically other than its default value.

{
    "componentName": "sc-selected-asset",
    "country": "au",
    "delayBeforeCallNum": 200,
    "EPSG": "EPSG:3111",
    "fullWidth": true,
    "geocodeSearchService": [
        {
            "apiKey": "a2338e05-e3cb425e93ad-109049bfb516",
            "autocompleteUrl": "https://www.geocode.farm/v3/json/forward/?addr=",
            "geocodeUrl": "https://www.geocode.farm/v3/json/reverse/",
            "name": "geocodefarm"
        }
    ],
    "heightNum": 2,
    "label": "Test sc-selected-asset",
    "layers": [
        {
            "color": "red",
            "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'d62a4970-d88e-11e6-92c9-934eb61df86d'}}],'must':[{'term':{'asset_category':'HYDRANT'}}]      }}}",
            "geoJsonField": "locationGeo",
            "imageFileNo": "62435f30-20fc-11e8-8329-0db8fb5fedc2",
            "tooltips": "HYDRANT {{{systemHeader.summaryName}}} created on {{{systemHeader.createdDate}}}"
        },
        {
            "color": "green",
            "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'d62a4970-d88e-11e6-92c9-934eb61df86d'}}],'must':[{'term':{'asset_category':'VALVE'}}]      }}}",
            "geoJsonField": "locationGeo",
            "imageFileNo": "355f8520-20fc-11e8-8329-0db8fb5fedc2",
            "tooltips": "VALVE {{{systemHeader.summaryName}}} created on {{{systemHeader.createdDate}}}"
        },
        {
            "color": "blue",
            "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'36811ce0-d885-11e6-92c9-934eb61df86d'}}]}}}",
            "geoJsonField": "locationGeo",
            "lineCap": "round",
            "lineDash": [
                10,
                20
            ],
            "lineWidth": 4,
            "tooltips": "PIPE {{{systemHeader.summaryName}}} created on {{{systemHeader.createdDate}}}"
        },
        {
            "color": "green",
            "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'b186a6b0-e439-11e7-8f5f-61ab7876b6fa'}}]}}}",
            "geoJsonField": "gblBoundaryTestDocument",
            "fill": "blue",
            "fillOpacity": 0.2,
            "layerDisplayOnly": true
        }
    ],
    "language": "en",
    "mapParameters": {
        "defaultLat": -37.8,
        "defaultLon": 144.9,
        "maxResolution": 2116.670900008467,
        "minResolution": 0.0116670900008467,
        "mapViews": [
            {
                "EPSG": "EPSG:3857",
                "isShow": true,
                "params": {
                    "BBOX": "16133701.716224,-4393099.8016821,16446787.78408,-4080013.733826",
                    "FIRSTTILE": true,
                    "FORMAT": "image/png",
                    "HEIGHT": "512",
                    "LAYERS": "CARTO_WM",
                    "REQUEST": "GetMap",
                    "SERVICE": "WMS",
                    "SRS": "EPSG:3857",
                    "STYLES": "",
                    "VERSION": "1.1.1",
                    "WIDTH": "512"
                },
                "serverType": "geoserver",
                "uiLabel": "V",
                "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
            },
            {
                "EPSG": "EPSG:3857",
                "params": {
                    "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
                    "FIRSTTILE": true,
                    "FORMAT": "image/png",
                    "HEIGHT": "512",
                    "LAYERS": "AERIAL_WM",
                    "REQUEST": "GetMap",
                    "SERVICE": "WMS",
                    "SRS": "EPSG:3857",
                    "STYLES": "",
                    "VERSION": "1.1.1",
                    "WIDTH": "512"
                },
                "serverType": "geoserver",
                "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms",
                "uiLabel": "S"
            },
            {
                "crossOrigin": null,
                "serverType": "tile",
                "uiLabel": "O",
                "url": "https://osm.formbird.com/tiles/{z}/{x}/{y}.png"
            },
            {
                "groupView": [
                    {
                        "EPSG": "EPSG:3857",
                        "params": {
                            "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
                            "FIRSTTILE": true,
                            "FORMAT": "image/png",
                            "HEIGHT": "512",
                            "LAYERS": "AERIAL_WM",
                            "REQUEST": "GetMap",
                            "SERVICE": "WMS",
                            "SRS": "EPSG:3857",
                            "STYLES": "",
                            "VERSION": "1.1.1",
                            "WIDTH": "512"
                        },
                        "serverType": "geoserver",
                        "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
                    },
                    {
                        "EPSG": "EPSG:3857",
                        "params": {
                            "BBOX": "16446787.78408,-4393099.8016821,16759873.851936,-4080013.733826",
                            "FIRSTTILE": true,
                            "FORMAT": "image/png",
                            "HEIGHT": "512",
                            "LAYERS": "CARTO_OVERLAY_WM",
                            "REQUEST": "GetMap",
                            "SERVICE": "WMS",
                            "SRS": "EPSG:3857",
                            "STYLES": "",
                            "VERSION": "1.1.1",
                            "WIDTH": "512"
                        },
                        "serverType": "geoserver",
                        "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
                    }
                ],
                "uiLabel": "M"
            }
        ],
        "zoom": 10
    },
    "name": "testScSelectedAsset",
    "popupAssetSelection": true,
    "popupAssetSelectionPrimaryText": "Primary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}",
    "popupAssetSelectionSecondaryText": "Secondary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}",
    "primaryAssetAddressSelection": true,
    "primaryAssetAddressField": "addressGeo",
    "primaryAssetFilter": "{'query':{'bool':{'filter':[]}}}",
    "primaryAssetGeometryField": "locationGeo",
    "secondaryAssetFilter": "{'query':{'bool':{'filter':[{'term':{ 'wat_category': 'POTABLE'}},{'term':{'systemHeader.systemType':'document'}},{'term':{'pipe_type':'RETMAIN'}}]}}}",
    "tooltips": "DISPLAYED FOR SELECTIONS {{{systemHeader.summaryName}}} created on {{{systemHeader.createdDate}}}",
    "tooltipsTimeout": 2
}

One or more of the optional fields shown below can be included in the above definition should a value other than their default value be required.

ROOT LEVEL OPTIONAL CUSTOMIZABLE FIELDS::
        "visible": false,
        "disableMouseWheel": true,
        "disableSave": true,
        "enabled": false,
        "mandatory": true,
        "hideAddress": true,
        "initialMapView": "map",
        "positionMandatory": true,
        "primaryImageAnchor": [
            0.5,
            1
        ],
        "primaryImageFileNo": "63d53643-65da-4db5-82f5-2af257845516",
        "secondaryImageAnchor": [
            0.5,
            1
        ],
        "secondaryImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8",
        "mandatoryFields": [
            "streetNo",
            "street",
            "suburb",
            "street"
        ],
        "noSecondaryAssetSelection": true,
        "singlePrimaryAssetSelection": true,
        "relatedFields": {
            "assetNumber": "assetNumber"
        },
        "addressImageAnchor": [
            0.5,
            1
        ],
        "addressImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8",
        "searchDelay": 1500,
        "searchMinLength": 5


LAYERS OPTIONAL CUSTOMIZABLE FIELDS:
    "imageAnchor": [
            0.5,
            1
        ],
    "layerDisplayOnly": true

 

4 Examples

Example 1

sc-selected-asset defined with all its required fields and optional fields. The required system field "componentName" is shown first followed by the other fields in alphabetical order. However the fields can be defined in any order.

        {
            "componentName": "sc-selected-asset",
            "addressImageAnchor": [
                0.5,
                1
            ],
            "addressImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8",
            "country": "au",
            "delayBeforeCallNum": 200,
            "disableMouseWheel": false,
            "disableSave": false,
            "enabled": true,
            "EPSG": "EPSG:3111",
            "fullWidth": true,
            "geocodeSearchService": [
                {
                    "apiKey": "a2338e05-e3cb425e93ad-109049bfb516",
                    "autocompleteUrl": "https://www.geocode.farm/v3/json/forward/?addr=",
                    "geocodeUrl": "https://www.geocode.farm/v3/json/reverse/",
                    "name": "geocodefarm"
                }
            ],
            "hideAddress": false,
            "initialMapView": "filter",
            "label": "Test sc-selected-asset",
            "layers": [
                {
                    "color": "red",
                    "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'d62a4970-d88e-11e6-92c9-934eb61df86d'}}],'must':[{'term':{'asset_category':'HYDRANT'}}]      }}}",
                    "geoJsonField": "locationGeo",
                    "imageFileNo": "62435f30-20fc-11e8-8329-0db8fb5fedc2",
                    "layerDisplayOnly": false,
                    "tooltips": "HYDRANT <b>{{{systemHeader.summaryName}}}</b> created on {{{systemHeader.createdDate}}}"
                },
                {
                    "color": "green",
                    "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'d62a4970-d88e-11e6-92c9-934eb61df86d'}}],'must':[{'term':{'asset_category':'VALVE'}}]      }}}",
                    "geoJsonField": "locationGeo",
                    "imageFileNo": "355f8520-20fc-11e8-8329-0db8fb5fedc2",
                    "tooltips": "VALVE <b>{{{systemHeader.summaryName}}}</b> created on {{{systemHeader.createdDate}}}"
                },
                {
                    "color": "blue",
                    "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'36811ce0-d885-11e6-92c9-934eb61df86d'}}]}}}",
                    "geoJsonField": "locationGeo",
                    "lineCap": "round",
                    "lineDash": [
                        10,
                        20
                    ],
                    "layerDisplayOnly": false,
                    "lineWidth": 4,
                    "tooltips": "PIPE <b>{{{systemHeader.summaryName}}}</b> created on {{{systemHeader.createdDate}}}"
                },
                {
                    "color": "green",
                    "filter": "{'query':{'bool':{'filter':[{'term':{'systemHeader.templateId':'b186a6b0-e439-11e7-8f5f-61ab7876b6fa'}}]}}}",
                    "geoJsonField": "gblBoundaryTestDocument",
                    "fill": "blue",
                    "fillOpacity": 0.2
                    "layerDisplayOnly": false
                }
            ],
            "language": "en",
            "mandatory": false,
            "mandatoryFields": [
                "streetNo",
                "street",
                "suburb",
                "street",
                "postcode",
                "locationDescription"
            ],
            "mapParameters": {
                "defaultLat": -37.8,
                "defaultLon": 144.9,
                "maxResolution": 2116.670900008467,
                "minResolution": 0.0116670900008467,
                "mapViews": [
                    {
                        "EPSG": "EPSG:3857",
                        "isShow": true,
                        "params": {
                            "BBOX": "16133701.716224,-4393099.8016821,16446787.78408,-4080013.733826",
                            "FIRSTTILE": true,
                            "FORMAT": "image/png",
                            "HEIGHT": "512",
                            "LAYERS": "WEB_MERCATOR",
                            "REQUEST": "GetMap",
                            "SERVICE": "WMS",
                            "SRS": "EPSG:3857",
                            "STYLES": "",
                            "VERSION": "1.1.1",
                            "WIDTH": "512"
                        },
                        "serverType": "geoserver",
                        "uiLabel": "V",
                        "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
                    },
                    {
                        "EPSG": "EPSG:3857",
                        "params": {
                            "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
                            "FIRSTTILE": true,
                            "FORMAT": "image/png",
                            "HEIGHT": "512",
                            "LAYERS": "AERIAL_WM",
                            "REQUEST": "GetMap",
                            "SERVICE": "WMS",
                            "SRS": "EPSG:3857",
                            "STYLES": "",
                            "VERSION": "1.1.1",
                            "WIDTH": "512"
                        },
                        "serverType": "geoserver",
                        "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms",
                        "uiLabel": "S"
                    },
                    {
                        "crossOrigin": null,
                        "serverType": "tile",
                        "uiLabel": "O",
                        "url": "https://osm.formbird.com/tiles/{z}/{x}/{y}.png"
                    },
                    {
                        "groupView": [
                            {
                                "EPSG": "EPSG:3857",
                                "params": {
                                    "BBOX": "16280475.531304,-4696291.0150527,16593561.59916,-4383204.9471967",
                                    "FIRSTTILE": true,
                                    "FORMAT": "image/png",
                                    "HEIGHT": "512",
                                    "LAYERS": "AERIAL_WM",
                                    "REQUEST": "GetMap",
                                    "SERVICE": "WMS",
                                    "SRS": "EPSG:3857",
                                    "STYLES": "",
                                    "VERSION": "1.1.1",
                                    "WIDTH": "512"
                                },
                                "serverType": "geoserver",
                                "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
                            },
                            {
                                "EPSG": "EPSG:3857",
                                "params": {
                                    "BBOX": "16446787.78408,-4393099.8016821,16759873.851936,-4080013.733826",
                                    "FIRSTTILE": true,
                                    "FORMAT": "image/png",
                                    "HEIGHT": "512",
                                    "LAYERS": "CARTO_OVERLAY_WM",
                                    "REQUEST": "GetMap",
                                    "SERVICE": "WMS",
                                    "SRS": "EPSG:3857",
                                    "STYLES": "",
                                    "VERSION": "1.1.1",
                                    "WIDTH": "512"
                                },
                                "serverType": "geoserver",
                                "url": "http://api.maps.vic.gov.au/vicmapapi-mercator/map-wm/wms"
                            }
                        ],
                        "uiLabel": "M"
                    }
                ],
                "zoom": 10
            },
            "name": "testScSelectedAsset",
            "noSecondaryAssetSelection": false,
            "popupAssetSelection": true,
            "popupAssetSelectionPrimaryText": "Primary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}",
            "popupAssetSelectionSecondaryText": "Secondary Asset {{{systemHeader.summaryName}}} State {{{operational_state}}}",
            "positionMandatory": false,
            "primaryAssetAddressSelection": true,
            "primaryAssetAddressField": "addressGeo",
            "primaryAssetFilter": "{'query':{'bool':{'filter':[]}}}",
            "primaryAssetGeometryField": "locationGeo",
            "primaryImageAnchor": [
                0.5,
                1
            ],
            "primaryImageFileNo": "63d53643-65da-4db5-82f5-2af257845516",
            "relatedFields": {
                "assetNumber": "assetNumber",
                "pipe_dia": "pipe_dia",
                "pipe_matr": "pipe_matrl",
                "pipe_type": "pipe_type"
            },
            "secondaryAssetFilter": "{'query':{'bool':{'filter':[{'term':{ 'wat_category': 'POTABLE'}},{'term':{'systemHeader.systemType':'document'}},{'term':{'pipe_type':'RETMAIN'}}]}}}",
            "secondaryImageAnchor": [
                0.5,
                1
            ],
            "secondaryImageFileNo": "8b526c40-e1c6-44c6-9c49-61d153f07cc8"
            "singlePrimaryAssetSelection": false,
            "tooltips": "DISPLAYED FOR SELECTIONS <b>{{{systemHeader.summaryName}}}</b> created on {{{systemHeader.createdDate}}}",
            "tooltipsTimeout": 2,
            "visible": true
        }

Resulting field displayed on the form:

sc-selected-asset-field-Example-1-Image-1

Resulting field displayed on the form after selecting a street address, 1 primary asset and 2 secondary assets:

sc-selected-asset-field-Example-1-Image-2

Resulting sc-selected-asset field saved in the database:

    "testScSelectedAsset": {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "properties": {
                    "type": "street",
                    "streetNo": "33",
                    "street": "Albert Street",
                    "suburb": "Footscray",
                    "postcode": "3011",
                    "country": "Australia",
                    "state": "Victoria"
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        144.898022374009,
                        -37.8017261934339
                    ]
                }
            },
            {
                "type": "Feature",
                "properties": {
                    "type": "primaryAsset",
                    "linkAssets": [
                        {
                            "documentId": "7c0877d0-369b-11e7-9680-bb972336ed93",
                            "name": "Water Pipe - 4218514",
                            "assetNumber": "4218514",
                            "pipe_dia": "150",
                            "pipe_matr": "CICL",
                            "pipe_type": "RETMAIN"
                        }
                    ]
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        144.89785774306455,
                        -37.80109735481854
                    ]
                }
            },
            {
                "type": "Feature",
                "properties": {
                    "type": "secondaryAsset",
                    "linkAssets": [
                        {
                            "documentId": "e5746210-369b-11e7-8373-c7e49b56c725",
                            "name": "Water Pipe - 4219951",
                            "assetNumber": "4219951",
                            "pipe_dia": "150",
                            "pipe_matr": "CICL",
                            "pipe_type": "RETMAIN"
                        }
                    ]
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        144.89704046787736,
                        -37.80068923509525
                    ]
                }
            },
            {
                "type": "Feature",
                "properties": {
                    "type": "secondaryAsset",
                    "linkAssets": [
                        {
                            "documentId": "f6f19df0-369b-11e7-8373-c7e49b56c725",
                            "name": "Water Pipe - 4220466",
                            "assetNumber": "4220466",
                            "pipe_dia": "100",
                            "pipe_matr": "AC",
                            "pipe_type": "RETMAIN"
                        }
                    ]
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        144.89861244636438,
                        -37.80088051859433
                    ]
                }
            }
        ]
    }