Populate a custom map layer
/rest/ofscMetadata/v1/mapLayers/custom-actions/populateLayers
Only 10 internal custom map layers are allowed for an Oracle Field Service environment. Therefore only 10 different labels are allowed in a request to create a map layer.
A shapefile (zip archive) is limited to 2 GB. Not all the information in the zip archive is imported and therefore the maximum amount of data stored as Internal Custom Map Layers is limited to 1 GB per Oracle Field Service environment. Oracle Field Service downloads the shapefile from the specified url in the background. You should verify the status of shapefile download and creation using the 'Check custom map layer population status' api.
Request
objectPopulate Layers Request-
authentication(required):
object Authentication
Title:
AuthenticationThe authentication used for downloading the geo-data from the external source specified in the URL field.
- If the URL points to an HTTP service, and the type of the authentication specified is 'basic', then Oracle Field Service sends a request to this URL to authenticate using the HTTP-Basic scheme with the username and password as credentials.
- If the URL points to an FTP service, and the type of the authentication specified is 'ftp', then Oracle Field Service connects via the FTP protocol using the username and password as credentials.
- If the type of the authentication specified is 'none', then Oracle Field Service downloads the geo-data without any authentication.
-
layerLabel(required):
string
Title:
Layer LabelMinimum Length:1Maximum Length:24Pattern:^[A-Za-z0-9_]+$The unique identifier of the layer. -
shapeHintButton:
object Plugin or form map layer hint button
Title:
Plugin or form map layer hint buttonThe object representing selected Custom Form or Plugin will be displayed as a button on layer hint. Parameters specified in Plugin/Form Field will be sent to the selected Custom Form or Plugin. -
shapeHintColumns:
array Shape Hint Columns
Title:
Shape Hint ColumnsThe set of objects that define the contents of the hint for the shapes on the map. -
shapeTitleColumn:
string
Title:
Shape Title ColumnMinimum Length:1Maximum Length:255The name of the non-spatial column that contains the titles of the shapes that are displayed on the map. -
SRID(required):
integer
Title:
SRIDThe spatial reference identifier (SRID) of the geo-data in the shape file. -
URL(required):
string
Title:
URLMinimum Length:1Maximum Length:255The URL of the external source from which the geo-data is downloaded. Supported protocols: HTTPS only.
objectAuthenticationThe authentication used for downloading the geo-data from the external source specified in the URL field.
- If the URL points to an HTTP service, and the type of the authentication specified is 'basic', then Oracle Field Service sends a request to this URL to authenticate using the HTTP-Basic scheme with the username and password as credentials.
- If the URL points to an FTP service, and the type of the authentication specified is 'ftp', then Oracle Field Service connects via the FTP protocol using the username and password as credentials.
- If the type of the authentication specified is 'none', then Oracle Field Service downloads the geo-data without any authentication.
-
password:
string
Title:
PasswordThe password used to authenticate the connection between Oracle Field Service and the external source. -
type(required):
string
Title:
TypeAllowed Values:[ "basic", "ftp", "none" ]The type of the authentication. The allowed values are 'none', 'basic', and 'ftp'. -
username:
string
Title:
UsernameThe username used to authenticate the connection between Oracle Field Service and the external source.
objectPlugin or form map layer hint button-
actionType(required):
string
Title:
PluginForm TypeAllowed Values:[ "plugin", "form" ]The type of plugin or form the activity hint button on map layer. -
label(required):
string
Title:
Label for plugin or formMinimum Length:1Maximum Length:64The label plugin or form for map layer hint.
arrayShape Hint Columnsobject-
defaultName(required):
string
Title:
Default Column NameThe unique name of the shapefile column. -
pluginFormField(required):
string
Title:
Plugin or Form Column NameMaximum Length:255 -
sourceColumn(required):
string
Title:
Source Column NameThe unique name of the source column in the user's language. The name specified in this parameter is displayed as a hint.
Response
- application/schema+json
- application/json
200 Response
objectPopulate Layers Response-
downloadId:
integer
Title:
Download IDThe identifier of the shape file specified in the request. -
status:
string
Title:
StatusThe status of the downloaded shape file. -
time:
string
Title:
TimeThe time when the operation started.
Default Response
object-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to create a shapefile and convert it into a map layer in Oracle Field Service Cloud by submitting a POST request on the REST resource using cURL.
Example of Request Header
The following shows an example of the request header.
POST /rest/ofscMetadata/v1/mapLayers/custom-actions/populateLayers/
Example of Request Body
The following example shows the contents of the request body in JSON format.
{
"URL": "https://www.example.com/workzones/shapes/sip/fileData.zip",
"authentication" :
{
"type" : "basic",
"username": "<CLIENT-ID>@<INSTANCE-NAME>",
"password": "<CLIENT-SECRET>"
},
"layerLabel": "AIRPORTS",
"SRID": 4269,
"shapeTitleColumn": "IATA",
"shapeHintColumns":
[
{
"sourceColumn": "NAME",
"defaultName": "Name"
},
{
"sourceColumn": "ICAO",
"defaultName": "ICAO Code"
},
{
"sourceColumn": "COUNTRY",
"defaultName": "Country"
},
{
"sourceColumn": "CITY",
"defaultName": "City"
},
{
"sourceColumn": "ALTITUDE",
"defaultName": "Altitude (ft)"
},
{
"sourceColumn": "TZNAME",
"defaultName": "Time Zone"
}
]
}
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK
Example of Response Body
The following example shows the contents of the response body in JSON format.
{
"downloadID":5a93c598f92621321d4fd257bf0da6d6,
"status":"pending",
"time": "2016-01-05 12:58:54"
}