Class: DownloadModel

Tools.Download DownloadModel

DownloadModel

new DownloadModel()

modules/tools/download/model.js, line 62
Properties:
Name Type Default Description
id String "download" Id.
name String "Download" Name.
glyphicon String "glyphicon-plus" Glyphicon class.
renderToWindow Boolean true Flag if tool should render to tool window.
channel Radio.channel Channel of tool.
formats Array.<String> ["KML", "GEOJSON", "GPX"] Default formats that are supported.
selectedFormat String "" The selected format.
features Array.<ol/Feature> [ The features to be donloaded.
dataString String "" The features converted as dataString.
fileName String "" The filename.
createFirstText String "", filled with "Bitte erstellen Sie zuerst eine Zeichnung oder einen Text!"- translated
unknownGeometry String "", filled with "Unbekannte Geometry:"- translated
formatText String "", filled with "Format"- translated
pleaseChooseText String "", filled with "Bitte Auswählen"- translated
filenameText String "", filled with "Dateiname"- translated
enterFilenameText String "", filled with "Bitte Dateiname angeben"- translated
loadDownText String "", filled with "Herunterladen"- translated
backText String "", filled with "Zurück"- translated
Fires:
Listens to Events:

Extends

Methods

changeLang(lng){Void}

modules/tools/download/model.js, line 77
change language - sets default values for the language
Name Type Description
lng String the language changed to

convertFeatures(features, format){String}

modules/tools/download/model.js, line 153
Converts the given features into the given format.
Name Type Description
features Array.<ol/Feature> The features to be downloaded.
format ol/Format The format for the features to be downloaded.
Returns:
The converted features as string.

convertFeaturesToKML(features, format){String}

modules/tools/download/model.js, line 177
Converts features to KML and also storing the style information.
Name Type Description
features Array.<ol/Feature> The features to be downloaded.
format ol/Format The format for the features to be downloaded.
Returns:
The converted features as string.

download(){void}

modules/tools/download/model.js, line 407
Triggers the download

getProjections(sourceProj, destProj, zone){Object}

modules/tools/download/model.js, line 244
Gets the projection in proj4 format.
Name Type Description
sourceProj String Source projection name.
destProj String Destination projection name.
zone String Zone of source projection.
Returns:
an object with the definitions of the goven projection names.

prepareData(){void}

modules/tools/download/model.js, line 120
Converts the data and saves it to the param "dataString"
Fires:

prepareDownloadButton(){void}

modules/tools/download/model.js, line 354
Prepares the download button. Distinguishes between IE and nonIE.
Fires:

prepareDownloadButtonIE(){void}

modules/tools/download/model.js, line 396
Prepares the download button for IE browsers.

prepareDownloadButtonNonIE(){void}

modules/tools/download/model.js, line 386
Prepares the download button for nonIE browsers.

reset(){void}

modules/tools/download/model.js, line 419
Resets the model.

setBlob(value){void}

modules/tools/download/model.js, line 477
Setter for attribute "blob".
Name Type Description
value Blob Blob.

setDataString(value){void}

modules/tools/download/model.js, line 450
Setter for attribute "dataString".
Name Type Description
value String The features saved as string.

setDisabledOnDownloadButton(isDisabled){void}

modules/tools/download/model.js, line 378
Enables or disables the download button.
Name Type Description
isDisabled Boolean Flag if download button is disabled or not.

setFeatures(value){void}

modules/tools/download/model.js, line 441
Setter for attribute "features".
Name Type Description
value Array.<ol/Feature> Features.

setFileName(value){void}

modules/tools/download/model.js, line 468
Setter for attribute "fileName".
Name Type Description
value String Filename without extension.

setFormats(value){void}

modules/tools/download/model.js, line 432
Setter for attribute "formats".
Name Type Description
value Array.<String> Formats.

inherited setGlyphicon(value){void}

modules/core/modelList/item.js, line 69
Setter for glyphicon
Name Type Description
value String Glyphicon

inherited setId(value){void}

modules/core/modelList/item.js, line 34
Setter for id
Name Type Description
value String Id

inherited setIsActive(value){void}

modules/core/modelList/tool/model.js, line 129
Activates or deactivates tool
Name Type Description
value Boolean Flag if tool is active

setIsInternetExplorer(value){void}

modules/tools/download/model.js, line 486
Setter for attribute "isInternetExplorer".
Name Type Description
value Boolean Flag if browser is ie.

inherited setIsInThemen(value){void}

modules/core/modelList/item.js, line 78
Setter for isInThemen
Name Type Description
value Boolean Flag if item is in themen

inherited setIsVisibleInMenu(value){void}

modules/core/modelList/item.js, line 105
Setter for setIsVisibleInMenu
Name Type Description
value Boolean Flag if item is visible in menu

inherited setIsVisibleInTree(value){void}

modules/core/modelList/item.js, line 96
Setter for isVisibleInTree
Name Type Description
value Boolean Flag if item is visible in layertree

inherited setLevel(value){void}

modules/core/modelList/item.js, line 87
Setter for level
Name Type Description
value String Level

inherited setName(value){void}

modules/core/modelList/item.js, line 52
Setter for name
Name Type Description
value String Name

inherited setParentId(value){void}

modules/core/modelList/item.js, line 43
Setter for parentId
Name Type Description
value String ParentId

setSelectedFormat(value){void}

modules/tools/download/model.js, line 459
Setter for attribute "selectedFormat".
Name Type Description
value String The selected Format.

inherited setType(value){void}

modules/core/modelList/item.js, line 60
Setter for type
Name Type Description
value String Type

start(obj){void}

modules/tools/download/model.js, line 98
Name Type Description
obj Object Configuration to start the download module.
Name Type Description
formats Array.<String> Formats to be supported.
features Array.<ol/Feature> Features to be downloaded.
Fires:

inherited superChangeLang(){Void}

modules/core/modelList/tool/model.js, line 113
change language - sets or translates the name of this tool, if property i18nextTranslate is no function. If name is defined in config.json, the name is not translated else property nameTranslationKey is used.

transformCoords(geometry, projections){ol/Coordinate}

modules/tools/download/model.js, line 260
Transform the given Geometry into the given projections.
Name Type Description
geometry ol/Geom Geometry.
projections Object Object containing the projections.
Fires:
Returns:
The projected coordinates.

transformLine(coords, projections){ol/Coordinate}

modules/tools/download/model.js, line 308
Transform the given line coords into the given projections.
Name Type Description
coords ol/Coordinate Coordinates.
projections Object Object containing the projections.
Fires:
Returns:
The projected coordinates.

transformPoint(point, projections){ol/Coordinate}

modules/tools/download/model.js, line 324
Transform the given point coords into the given projections.
Name Type Description
point ol/Coordinate Coordinates.
projections Object Object containing the projections.
Fires:
Returns:
The projected coordinates.

transformPolygon(coords, projections){ol/Coordinate}

modules/tools/download/model.js, line 290
Transform the given polygon coords into the given projections.
Name Type Description
coords ol/Coordinate Coordinates.
projections Object Object containing the projections.
Fires:
Returns:
The projected coordinates.

validateFileNameAndExtension(){String}

modules/tools/download/model.js, line 332
Validates the Filename and appends the extension if the user didnt add it.
Returns:
the generated fileName.