GeoBAK Integration API

Methods

# addGraphics(data)

This function adds a single graphic or an array of graphics to the basic graphic layer of the map. Graphics can optional added as sketch, so that user can edit the graphic.

Parameters:
Name Type Description
data Graphic | Array.<Graphic> | AddGraphicObject

One or multiple graphics.

Tutorials:

# addGraphicsToGraphicsMapLayer(data)

This function adds an array of graphics to the given graphic layer, which was created as "GRAPHICS_MAP_LAYER"

Parameters:
Name Type Description
data graphicsMapLayerObject

GraphicsArray and target layerId

Tutorials:

# analyze(data)

This function sends a request for analyzing the passed location using a given url. Check the tutorial) for more information.

Parameters:
Name Type Description
data AnalysisParams
Tutorials:

# checkIntegrationAPI()

This function can be used to check if the integrationAPi is available for requests. It will send an event with the name "integrationApiReady".

Tutorials:

# clearAllGraphics(dataopt)

This function deletes all graphics from the basic graphic layer

Parameters:
Name Type Attributes Description
data DeleteAllObject <optional>

optional Object to indicate if sketches and / or graphics should be deleted.

Tutorials:

# clearGraphics(data)

This function deletes specific graphic objects with the given id's from the basic graphic layer

Parameters:
Name Type Description
data Number | Array.<Number> | GraphicObject

Array of graphic object id's, that should be deleted

Tutorials:

# createServiceLayer(data)

This function creates a service layer (arcGis Feature-Layer, MapImageLayer)

Parameters:
Name Type Description
data ServiceLayerObject
Tutorials:

# filterObjects(query) → {Object}

This function filters objects in the currently shown map

Parameters:
Name Type Description
query FilterObject

Query object. Empty array [] to reset filter

Tutorials:

Result object

Object

# generateMapExport(data)

This function will create a screenshot from the currently shown map.

Parameters:
Name Type Description
data ScreenshotParameter

function with parameter, that should be executed

Tutorials:
Example
const data = {
         params: {
         format: "png",
         quality: 98,
         extent: {"spatialReference":{"wkid":25833},"xmin":372142.79913043475,"ymin":5656313.801304349,"xmax":387339.59652173915,"ymax":5664285.891739132},
         title: "Testitle",
         copyright: "01.01.2022",
         directDownload: false // set to true if you want to get the result as base64 code
         }
}

# geoDocumentService(data)

This function sends a print request for geo documents.

Parameters:
Name Type Description
data PrintGeoDocument
Tutorials:

# getAllCreatedObjectsFromMap(data)

This function returns all graphics, that have been drawn by the sketching tool

Parameters:
Name Type Description
data FilterGraphicsParam

Parameters which can be used to filter the graphics available in the map

Tutorials:

# getMapExtentFromAllCreatedObjects(data)

This function returns the current extent of all graphics.

Parameters:
Name Type Description
data FilterGraphicsParam

Parameters which can be used to filter the graphics, where the minimum extent should be calculated from.

Tutorials:

# getSelectedObjects() → {Object}

This function returns the selected objects from the selection tool

Tutorials:

Result object

Object

# getVisibleExtent() → {Object}

This function returns the currently shown map extent

Tutorials:
Object

# onMapLoaded(data)

This function will wait until the map is ready and then execute the given function. Use this function before calling methods like zoomTo. Make sure the IntegrationAPI is already initialised, like it is shown in the tutorial.

Parameters:
Name Type Description
data Object

function with name and specific parameter

Tutorials:

# removeAllGraphicsFromGraphicsMapLayer(data)

This function deletes all graphics from the given graphic layer, which was created as "GRAPHICS_MAP_LAYER"

Parameters:
Name Type Description
data layerIdObject

layerId from where all existing graphics should be deleted

Tutorials:

# removeGraphicsFromGraphicsMapLayer(data)

This function removes an array of graphics to the given graphic layer, which was created as "GRAPHICS_MAP_LAYER"

Parameters:
Name Type Description
data graphicsMapLayerObject

GraphicsArray and target layerId

Tutorials:

# removeServiceLayer(data)

This function removes a service layer (arcGis Feature-Layer, MapImageLayer)

Parameters:
Name Type Description
data ServiceLayerObject
Tutorials:

# resetFeatureAttribute()

This functions removes highlights, that have been set by the setPostMessage Attribute for maps.

Tutorials:

# searchUpdate()

This function activates a watch, that sends a message every time a search result is updated. They can be listend by the "searchUpdate" event.

Tutorials:

# setElementVisibility(data)

This function allows to change the visibility of html-elements by cssClass-identifier

Parameters:
Name Type Description
data ElementDefinition
Tutorials:

# setObjectSelectionCustomResponse(data)

This function can be used to change the event name or the target for custom event handling.

Parameters:
Name Type Description
data EventTargetObject

event and target specific data

Tutorials:

# setSketchUpdate(data)

This function activates a watch, that sends a message every time a sketch is updated. They can be listend by the "setSketchUpdate" event.

Parameters:
Name Type Description
data FilterGraphicsParam

Parameters which can be used to filter the graphics, where the minimum extent should be calculated from.

Tutorials:

# setToolVisibility(data)

This function allows to change the visibility of map tools

Parameters:
Name Type Description
data ToolsDefinition
Tutorials:

# setUserInteraction(data)

This function sets or unset the user interactions possibilities.

Parameters:
Name Type Description
data UserInteractionObject
Tutorials:

# zoomTo(data)

This function zooms to the given geometry object

Parameters:
Name Type Description
data GoToObject
Tutorials:

# zoomToAllGraphicObjects(data)

This function zooms to the extent of all graphics, that have been drawn by the sketching tool

Parameters:
Name Type Description
data FilterGraphicsParam

Parameters which can be used to filter the graphics, where the minimum extent should be calculated from.

Tutorials:

Type Definitions

Object

# AddGraphicObject

Properties:
Name Type Attributes Description
sketch Boolean <optional>

add graphic as sketch. Default: "false"

options AddGraphicOptions <optional>

add custom options.

graphics Graphic | Array.<Graphic>

esri Javascript graphic geometry. Check esri Graphic documentation for all information.

Object

# AddGraphicOptions

Properties:
Name Type Attributes Description
zoomToGraphics Boolean <optional>

indicates if the view should zoom to the extent of the added graphics. default: "false".

scale Number <optional>

set the scale for the zoom (only valid for zoomToGraphics==true)

animations AnimationsObject <optional>

set the animations options (only valid for zoomToGraphics==true)

Object

# AnalysisParams

Properties:
Name Type Attributes Description
url String

Analysis-Service endpoint which should be used for the corresponding request. Please contact the GeoSN for further information or check the provided tutorial.

graphics Graphic | Array.<Graphic>

esri Javascript graphic geometry, which should be passed to the Analysis-Service. Check esri Graphic documentation for all information.

timeout String <optional>

Time in milliseconds after the Analysis-Service request should be aborted,

Object

# AnimationsObject

Properties:
Name Type Description
animate Boolean

indicates if the transition to the new view should be animated.

duration Number

the duration of the animation in milliseconds.

easing String

the easing function used for the animation. Possible Values: "linear"|"ease"|"ease-in"|"ease-out"|"ease-in-out"

Object

# CenterPoint

Properties:
Name Type Description
x Number
y Number
Object

# DeleteAllObject

Properties:
Name Type Attributes Description
graphics Boolean <optional>

indicates if graphics should be deleted. Default value: true

sketch Boolean <optional>

indicates if sketches should be deleted. Default value: false

Object

# ElementDefinition

Element definition for html elements

Properties:
Name Type Description
mode String

Possible Values: "show", "hide"

cssClass String

css-identifier for elements

Example
{
     "mode" : "show",
     "cssClass": "ct-omnisearch"
}
Object

# EventTargetObject

Properties:
Name Type Attributes Description
eventName String <optional>

optional parameter for a custom event name for the response

target String <optional>

optional parameter for a custom target on a multiple maps application

Geometry

# Extent

An Extent definition is used to define a bounding box on the map. A extent is defined by two coordinates, the lower left and the upper right coordinate. Using these two coordinates, a rectangle is defined. Check esri Extent documentation for all information.

Properties:
Name Type Description
xmin Number

The minimum X-coordinate of an extent envelope.

xmax Number

The maximum X-coordinate of an extent envelope.

ymin Number

The minimum Y-coordinate of an extent envelope.

ymax Number

The maximum Y-coordinate of an extent envelope.

SpatialReference spatialReference

The spatial reference of the geometry.

Example
{
	xmin: 375504.3860485149,
	ymin: 5635883.419447349,
	xmax: 445979.3261275071,
	ymax: 5690535.894671297,
	spatialReference: {
		wkid: 25833
	}
}
Object

# FilterGraphicsParam

The FilterGraphicsParam object can be used to filter the returned graphic-features, which are currently stored in the map.

Properties:
Name Type Attributes Description
excludeSearchFeatures Boolean <optional>

Excludes all features, which were added/highlighted by a search result. Default: true

excludeCoordinateSearchFeatures Boolean <optional>

Excludes all features, which were added via a coordinate-search tool. Default: true

excludeSketchingFeatures Boolean <optional>

Excludes all features, which were added/drawn manually by an user. Default: false

excludeIntegrationAPIFeatures Boolean <optional>

Excludes all features, which were added programmatically using the IntegrationAPI. Default: false

Example
//define all properties separately
{
	"excludeSearchFeatures": true,
	"excludeCoordinateSearchFeatures": true,
	"excludeSketchingFeatures": false,
	"excludeIntegrationAPIFeatures": false
}
//define an empty object to use default values
{}
Object

# FilterObject

An object, which defines a filter query.

Properties:
Name Type Attributes Description
layerId String

layerId that should be filterd

query String <optional>

query for feature layer ArcGis Query

type String <optional>

optinal set custom Type e.g. CLUSTER_FEATURE_LAYER

Example
//Show only features where: name=Chemnitz OR name=Landratsamt Bautzen
{
	"layerId": "standorte_uVb",
	"query": [
		{
			"field": "Name",
			"values": [
				"Stadt Chemnitz",
				"Landratsamt Bautzen"
			]
		}
	]
}

//reset all filters
"query": []
Object

# FunctionParameter

The FunctionParameter definition is one of the key information how the GeoBAK Integration API can be used. The postEvent/postMessage approach (cf. general information) accepts two parameters, which used to call the functionName matching function. Passed parameter are used to parametrize the Integration API functions. For div-integration the parameter eventName is mandatory to prevent endless loops in requests and responses.

Properties:
Name Type Attributes Description
functionName String

Check the Method section for the available functions.

detail Object

Check the Method section for the available functions. The corresponding documented functions list the needed parameter definition.

target String <optional>

Optional parameter to specify the target id value. Necessary for multiple map instances on a single page in an iframe integration

eventName String <optional>

Optional parameter to change the standard response from "message" to your eventName. Necessary for div-integration to prevent endless-loops.

Object

# Geometry

The base class for geometry objects like "Point", "Polygon", "Polyline" and more. Check esri Geometry documentation for all information.

Object

# GoToObject

Properties:
Name Type Attributes Description
geometry Geometry <optional>

esri geometry object. Check https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html documentation for all information.

scale Number <optional>

represents the map scale at the center of the view.

animations AnimationsObject <optional>

animations object.

Object

# Graphic

A Graphic represents a feature, which can be passed to the map, where it is visualized as a graphic. A graphic is built from the geometry property (to control, where the graphic is placed) and from a symbol (to control how the Graphic should look). Optionally attributes can be passed to define additional information for the graphic. Check esri Graphic documentation for all information.

Properties:
Name Type Attributes Description
geometry Point | Polyline | Polygon

The geographic representation to define where the Graphic should be placed on the map.

symbol Symbol

The visual representation to define how the graphic should be styles.

attributes Object <optional>

Additional attributes defined by a key-value based object.

Example
//Point graphic
{
	"geometry": {
		"x": 405544.1381646148,
		"y": 5666228.91967659,
		"spatialReference": {
			"wkid": 25833
		}
	},
	"symbol": {
		"type": "esriSMS",
		"style": "esriSMSCircle",
		"color": [255, 0, 0, 255],
		"size": 10,
		"angle": 0,
		"xoffset": 0,
		"yoffset": 0,
		"outline": {
			"color": [0, 0, 0, 255],
			"width": 1,
			"type": "esriSLS",
			"style": "esriSLSSolid"
		}
	},
	"attributes": {
		"firstMessage": "Hello World",
		"secondMessage": "How are you?",
		"numericalValue": 1,
	}
}
Object

# GraphicMapFeature

Graphic map feature, which are as features within a custom generated GRAPHICS_MAP_LAYER layer.

Properties:
Name Type Description
minScale Number
maxScale Number
geometry Graphic
symbol Symbol
attributes Object

your custom properties

maptipTemplate MaptipTemplate

your custom properties

popupTemplate PopupTemplate

your custom properties. Check esri documentation documentation for all information.

Object

# GraphicObject

Properties:
Name Type Description
id String | Number | Array.<String> | Array.<Number>
layerId String | Number
Example
{
    "id" : 50,
    "layerId": "sketch-graphics"
}
Object

# graphicsMapLayerObject

Properties:
Name Type Attributes Description
graphics Array.<Graphic> <optional>

graphics that should be added/removed from the given layer (defined by layerId property).

layerId layerId

identifies the layer (usually defined via id)

Object

# layerIdObject

Properties:
Name Type Description
layerId layerId

identifies the layer (usually defined via id)

Object

# MaptipTemplate

Maptip for graphic map feature

Properties:
Name Type Description
content String

html string for tip: <p><b>your name: {name}</b></p>, where {name} is your attribute identifier.

Geometry

# Multipoint

A MultiPoint definition is used to define a 1..n location via point coordinates on the world. Although many points can be passed, the Multipoint-Features is handled as one object. Check esri Multipoint documentation for all information.

Properties:
Name Type Description
points Array.<Array.<Point>>

An array of points.

spatialReference SpatialReference

The spatial reference of the geometry.

Example
{
 "points": [
     [405544.13,5666228.11],
     [-405544.438,5666228.41],
     [405544.83,5666228.79]
  ],
	spatialReference: {
		wkid: 25833
	}
}
Geometry

# Point

A Point definition is used to define a concrete location via two coordinates on the world. Check esri Point documentation for all information.

Properties:
Name Type Attributes Description
x Number

The x-coordinate (easting) of the point in map units.

y Number

The y-coordinate (northing) of the point in map units.

z Number <optional>

The z-coordinate (or elevation) of the point in map units.

spatialReference SpatialReference

The spatial reference of the geometry.

Example
{
	x:405544.1381646148,
	y:5666228.91967659,
	z: 1,
	spatialReference: {
		wkid: 25833
	}
}
Geometry

# Polygon

A Polygon definition is used to define an area on the map. A polygon is defined by 3..n coordinates, which act as the corresponding vertices. To define a valid polygon, the first and last point need to be equal. Check esri Polygon documentation for all information.

Properties:
Name Type Description
rings Array.<Array.<Array.<Point>>>

An array of rings.

SpatialReference SpatialReference

The spatial reference of the geometry.

Example
{
	rings: [
		[
			[350050.8556296119, 5684554.6972079985],
			[355095.69949643774, 5686083.437773703],
			[358611.8027975588, 5674159.261361206],
			[352038.21836502815, 5670948.9061732255],
			[346534.75232849084, 5676605.246266333],
			[350050.8556296119, 5684554.6972079985],
		],
	],
	spatialReference: {
		wkid: 25833
	}
}
Geometry

# Polyline

A Polyline definition is used to define a line on the map. A polyline is defined by 2..n coordinates, which act as the corresponding vertices. Check esri Polyline documentation for all information.

Properties:
Name Type Description
paths Array.<Array.<Array.<Point>>>

An array of paths, or line segments, that make up the polyline (Number[][][]).

SpatialReference SpatialReference

The spatial reference of the geometry.

Example
{
	"paths": [
		[
			[
				336750.81270798019,
				5666056.936362971
			],
			[
				336750.81270798019,
				5664681.069853836
			],
			[
				400040.67212815888,
				5654285.634007043
			],
			[
				400652.1683544408,
				5656272.99674246
			],
			[
				400805.0424110113,
				5656731.618912171
			]
		]
	],
	spatialReference: {
		wkid: 25833
	}
}
Object

# PrintGeoDocument

Properties:
Name Type Attributes Description
profile String <optional>

templates set by the app admin. Example vales in the documentation are "default" & "luftbild". Additional parameter replace the template values

service String <optional>

Possible values "print", "export".

layout String <optional>

Possible values for "print": "A4 Hoch", "A4 Quer", "A3 Hoch", "A3 Quer", "A2 Hoch", "A2 Quer", "A1 Hoch", "A1 Quer", "A4 Hoch", "A4 Quer". For "export": "A4 Hochformat", "A4 Querformat", "A3 Hochformat", "A3 Querformat", "A2 Hochformat", "A2 Querformat", "A1 Hochformat", "A1 Querformat", "A4 Hochformat", "A4 Querformat"

dpi Number <optional>

Possible values: 96, 150, 300.

fileformat String <optional>

Necessary for "export". Possible values: "PNG8", "PNG32", "JPG", "GIF", "PDF"

extentToPrint String | Object <optional>

Possible values: "graphics", "view", "custom", {}. Default: "custom".
"graphics" : Set the extent to the extent of all sketching tool graphics.
"view": Sets the context to the current visible map extent.
"custom": Use the boundingBox parameter for a custom extent.
{extent: "graphics|custom", expandExtentBy: 1.1 }: Use one of the above-mentioned extent params. Using the expandExtentBy property the calculated extent can be extended by e.g. 10%.
Please note: "view" is not supported as here the actual view-extent must be used.
Please note: If "graphics" is used and the calculated extent (defined by corresponding graphic(s)) results in a scale less than 1:500, a fallback is applied. In this case, 1:500 is set automatically so the result-export shows a valid and usable mapview. \

title String <optional>

Title of the document.

description String <optional>

Description of the document.

center CenterPoint <optional>

Center of view. Can be set with or without boundingBox. Assure that both values aren't contradictory.

boundingBox Extent <optional>

print view bounding box. Can be set with or without center. Assure that both values aren't contradictory.

scale Number <optional>

represents the map scale.

legend Boolean <optional>

default: false

graphics Array.<Graphic> <optional>

graphics that should be added to the map. If This is set, sketches from the user will be ignored.

searchResult Boolean <optional>

show the search results. Default: true

directDownload: Boolean <optional>

default: false. Set to true if the result pdf/image should automatically be opened in a new tab.

Object

# Result

Result object

Properties:
Name Type Description
reason string

function name

data Object

method specific object

Object

# ScreenshotParameter

A ScreenshotParameter set is used to define the information for the ScreenshotModel. It includes the geographic extent (the area which should be included in the map) as well as further information defined by textual information.

Properties:
Name Type Description
format String

The format of the resulting encoded data url (possible Values:"jpg"|"png")

quality Number

The quality (0 to 100) of the encoded image when encoding as jpg

extent Extent

Geographical extent which should be visible in the export

title String

Title which is included in the export as a label

copyright String

Copyright which is included in the export as a label

directDownload String

Controls whether the print export should be downloaded automatically. Default: false.

Example
{
	"extent": {
		"xmin": 361956.5945940225,
		"ymin": 5623086.214842096,
		"xmax": 475992.23933197866,
		"ymax": 5700080.118829904,
		"spatialReference": {"wkid": 25833}
	},
	"format": "png",
	"quality": 98,
	"title": "Example Screenshot",
	"copyright": "Hello World",
	"directDownload": false
}
Object

# ServiceLayerObject

Service layer properties (ArcGIS Feature-Layer, ArcGIS MapImageLayer and GraphicLayers)

Properties:
Name Type Attributes Description
id String

id for the new layer

title String <optional>

title for the new layer

description String <optional>

description for the new layer

serviceUrl String <optional>

service url for a web service

visible Boolean <optional>

initial service visibility

listMode String <optional>

controlls the visible witin toc (show|hide)

opacity Number <optional>

initial opacity for service

query String <optional>

query filter for web service

layers Array.<SublayerDefinition> <optional>

sublayerdefinition for web services

graphics Array.<Graphic> <optional>

Graphics array for direct graphic input

symbol Symbol <optional>

graphic symbol for optional styling

features Array.<GraphicMapFeature> <optional>

graphic features if you use "GRAPHICS_MAP_LAYER"

setCursorStyleToPointer String <optional>

Set the cursor style to "pointer" which is applied by hovering a feature. Property is only valid for "GRAPHICS_MAP_LAYER". If graphics has attributes or popup is enabled, style is always set to "pointer". Otherwise, default cursor is applied.

popupEnabled Boolean <optional>

enable / disable popups. Default: false

setPostMessage Boolean <optional>

send event via integrationAPI if the user clicks an item.

type String

possible Values are "AGS_DYNAMIC", "AGS_FEATURE", "AGS_IMAGE", "GRAPHICS", "GRAPHICS_MAP_LAYER" , "WMS"

Object

# SublayerDefinition

Properties:
Name Type Description
id String
query String
Object

# Symbol

A Symbol definition is used to define a visual representation of a feature. Symbols can be defined in several ways, including specific styling for different features. Check esri Symbol documentation for all information.

Properties:
Name Type Description
color String

esri Javascript color object. Check Color documentation for all information.

type String

Possible Values:"simple-marker", "picture-marker", "simple-line", "simple-fill", "picture-fill", "text", "shield-label-symbol", "point-3d", "line-3d", "polygon-3d", "web-style", "mesh-3d", "label-3d", "cim"

Example
//Symbol for points
{
	"type": "esriSMS",
	"style": "esriSMSCircle",
	"color": [255, 0, 0, 255],
	"size": 10,
	"angle": 0,
	"xoffset": 0,
	"yoffset": 0,
	"outline": {
		"color": [0, 0, 0, 255],
		"width": 1,
		"type": "esriSLS",
		"style": "esriSLSSolid"
	}
}
//Symbol for lines and polygons
{
	"color": [0, 0, 0, 64],
	"outline": {
		"color": [255, 0, 0, 255],
		"width": 0.75,
		"type": "esriSLS",
		"style": "esriSLSSolid"
	},
	"type": "esriSFS",
	"style": "esriSFSSolid"
}
Object

# ToolsDefinition

Tools definition for map tools

Properties:
Name Type Description
mode String

Possible Values: "show", "hide"

toolsetDefinition Object

Toolset definition to hide or show

Example
{
     "mode" : "show",
     "toolsetDefinition": {
         "id": "mapview_tools",
         "tools": [
             "zoomInTool",
             "zoomOutTool",
             "locateMeTool"
         ],
         "registerWidget": {
             "widgetRole": "mapview_tools"
         },
         "container": "ignore",
         "windowType": "container",
         "cssClass": "muted"
     }
}
Object

# UserInteractionObject

Properties:
Name Type Attributes Description
userInteraction Boolean <optional>

indicates if the user interaction should be deactivated.