Skip to content
Snippets Groups Projects
Commit d8e44003 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

filled jsdoc with content (now that it is generated)

parent 9b08ea2c
No related branches found
No related tags found
No related merge requests found
Showing
with 282 additions and 24 deletions
...@@ -5,7 +5,7 @@ module.exports = function(grunt) { ...@@ -5,7 +5,7 @@ module.exports = function(grunt) {
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
jshint: { jshint: {
files: ['Gruntfile.js', 'src/main/webapp/js/**/*.js', '!src/main/webapp/js/lib/**/*.js'], all: ['Gruntfile.js', 'src/main/webapp/js/**/*.js', '!src/main/webapp/js/lib/**/*.js'],
options: { options: {
browser: true, browser: true,
expr: true, expr: true,
...@@ -31,9 +31,12 @@ module.exports = function(grunt) { ...@@ -31,9 +31,12 @@ module.exports = function(grunt) {
} }
}, },
jsdoc: { jsdoc: {
dist: { all: {
src: ['src/main/webapp/js/**/*.js', '!src/main/webapp/js/lib/**/*.js'], src: ['src/main/webapp/js/**/*.js', '!src/main/webapp/js/lib/**/*.js', 'JsDoc.md'],
dest: 'build/docs/jsdoc' dest: 'build/docs/jsdoc',
options: {
private: false
}
} }
} }
}); });
......
This is the technical javascript documentation for the isochrone project.
It contains all the classes which are needed to bring the isochrone web frontend to live.
...@@ -254,6 +254,14 @@ eclipse { ...@@ -254,6 +254,14 @@ eclipse {
Node matcherVagrant = filterVagrant.appendNode('matcher') Node matcherVagrant = filterVagrant.appendNode('matcher')
matcherVagrant.appendNode('id', 'org.eclipse.ui.ide.multiFilter') matcherVagrant.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherVagrant.appendNode('arguments', '1.0-name-matches-false-false-.vagrant') matcherVagrant.appendNode('arguments', '1.0-name-matches-false-false-.vagrant')
Node filterNodeModules = filteredResources.appendNode('filter')
filterNodeModules.appendNode('id', 1396275587572)
filterNodeModules.appendNode('name', '')
filterNodeModules.appendNode('type', 14)
Node matcherNodeModules = filterNodeModules.appendNode('matcher')
matcherNodeModules.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherNodeModules.appendNode('arguments', '1.0-name-matches-false-false-node_modules')
} }
} }
} }
......
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
}, },
"devDependencies": { "devDependencies": {
"grunt-contrib-jshint": "~0.9.2", "grunt-contrib-jshint": "~0.9.2",
"grunt-jsdoc": "~0.5.0" "grunt-jsdoc": "~0.5.4"
} }
} }
\ No newline at end of file
/** /**
* Singleton class configuration. * Used to store the client's configuration
* This is used to store the client's configuration *
* @singleton
* @class Configuration
*/ */
define(['console'], function(logger) { define(['console'], function(logger) {
var instance = null; var instance = null;
...@@ -9,6 +11,10 @@ define(['console'], function(logger) { ...@@ -9,6 +11,10 @@ define(['console'], function(logger) {
var datasetConfigMap = {}; var datasetConfigMap = {};
var mapserverUrl = null; var mapserverUrl = null;
/**
* @private
* @method Configuration#addDatasetConfig
*/
this.addDatasetConfig = function(dSetConfig) { this.addDatasetConfig = function(dSetConfig) {
if (!dSetConfig || !dSetConfig.datasetName) { if (!dSetConfig || !dSetConfig.datasetName) {
logger.warn('Not adding invalid dataset configuration to client configuration singleton'); logger.warn('Not adding invalid dataset configuration to client configuration singleton');
...@@ -19,18 +25,34 @@ define(['console'], function(logger) { ...@@ -19,18 +25,34 @@ define(['console'], function(logger) {
datasetConfigMap[dSetConfig.datasetName] = dSetConfig; datasetConfigMap[dSetConfig.datasetName] = dSetConfig;
}; };
/**
* @private
* @method Configuration#getDatasetConfigMap
*/
this.getDatasetConfigMap = function() { this.getDatasetConfigMap = function() {
return datasetConfigMap; return datasetConfigMap;
}; };
/**
* @private
* @method Configuration#getDatasetConfig
*/
this.getDatasetConfig = function(datasetName) { this.getDatasetConfig = function(datasetName) {
return datasetConfigMap[datasetName]; return datasetConfigMap[datasetName];
}; };
/**
* @private
* @method Configuration#getMapserverUrl
*/
this.getMapserverUrl = function() { this.getMapserverUrl = function() {
return mapserverUrl; return mapserverUrl;
}; };
/**
* @private
* @method Configuration#setMapserverUrl
*/
this.setMapserverUrl = function(url) { this.setMapserverUrl = function(url) {
var i = url.indexOf('://'); var i = url.indexOf('://');
if (i <= 0) { if (i <= 0) {
...@@ -44,6 +66,10 @@ define(['console'], function(logger) { ...@@ -44,6 +66,10 @@ define(['console'], function(logger) {
} }
return { return {
/**
* @public
* @method Configuration.getInstance
*/
getInstance: function() { getInstance: function() {
if (instance === null) { if (instance === null) {
instance = new Configuration(); instance = new Configuration();
......
/**
* @class InitHelper
*/
define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/serviceIsochrone', 'service/serviceConfiguration', 'isochrone/searchExtender', 'jQueryUI', 'jQueryUI-timepicker'], function($, logger, IsoMap, Websocket, ServiceIsochrone, ServiceConfiguration, SearchExtender) { define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/serviceIsochrone', 'service/serviceConfiguration', 'isochrone/searchExtender', 'jQueryUI', 'jQueryUI-timepicker'], function($, logger, IsoMap, Websocket, ServiceIsochrone, ServiceConfiguration, SearchExtender) {
function InitHelper() { function InitHelper() {
var serviceConfig = null; var serviceConfig = null;
...@@ -7,6 +10,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s ...@@ -7,6 +10,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s
// Public methods // Public methods
/**
* @public
* @method InitHelper#initMap
*/
this.initMap = function() { this.initMap = function() {
logger.debug('Initializing map'); logger.debug('Initializing map');
...@@ -21,6 +28,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s ...@@ -21,6 +28,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s
$(document).on('isomap_draw', extendSearch.bind(this)); $(document).on('isomap_draw', extendSearch.bind(this));
}; };
/**
* @public
* @method InitHelper#initPreferences
*/
this.initPreferences = function() { this.initPreferences = function() {
$('#help-dialog').dialog({ $('#help-dialog').dialog({
autoOpen: false, autoOpen: false,
...@@ -48,6 +59,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s ...@@ -48,6 +59,10 @@ define(['jQuery', 'console', 'isochrone/isoMap', 'service/websocket', 'service/s
// Private methods // Private methods
/**
* @private
* @method InitHelper#extendSearch
*/
function extendSearch() { function extendSearch() {
var searchExtender = new SearchExtender(isoMap.getMap(), function() { var searchExtender = new SearchExtender(isoMap.getMap(), function() {
serviceIsochrone.sentRequest.apply(this, arguments); serviceIsochrone.sentRequest.apply(this, arguments);
......
/**
* @class IsoMap
*/
define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'map/control/help', 'map/control/settings', 'map/control/wswarning', 'map/control/geosearch', 'map/control/geosearchProvider/osm', 'map/ipLocator/ipProvider', 'map/ipLocator/ipLocator'], function($, L, logger, BingLayer, GoogleLayer, HelpControl, SettingsControl, WsWarningControl, GeoSearch, OSMProvider, IpProvider, IpLocator) { define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'map/control/help', 'map/control/settings', 'map/control/wswarning', 'map/control/geosearch', 'map/control/geosearchProvider/osm', 'map/ipLocator/ipProvider', 'map/ipLocator/ipLocator'], function($, L, logger, BingLayer, GoogleLayer, HelpControl, SettingsControl, WsWarningControl, GeoSearch, OSMProvider, IpProvider, IpLocator) {
// Private static fields // Private static fields
var INNSBRUCK = [47.265718, 11.391342]; var INNSBRUCK = [47.265718, 11.391342];
// var VIENNA = [48.186312, 16.317615]; // var VIENNA = [48.186312, 16.317615];
// Class function (a.k.a. constructor) // Class function (a.k.a. constructor)
function IsoMap(div) { function IsoMap(div) {
// self has to be used instead of this in private methods to refer to public vars/mathods // self has to be used instead of this in private methods to refer to public vars/mathods
// var self = this; // var self = this;
...@@ -32,12 +36,20 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -32,12 +36,20 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
* Gets the internal map object. * Gets the internal map object.
* This is only useful after the map has been drawn * This is only useful after the map has been drawn
* *
* @return the map object. Null if the map has not been drawn. * @public
* @method IsoMap#getMap
* @return {Object} the map object. Null if the map has not been drawn.
*/ */
this.getMap = function() { this.getMap = function() {
return map; return map;
}; };
/**
* Draws the map into the div container referenced by the mDiv class attribute.
*
* @public
* @method IsoMap#draw
*/
this.draw = function() { this.draw = function() {
logger.log('Drawing map'); logger.log('Drawing map');
logger.debug(' - options:', mapOptions); logger.debug(' - options:', mapOptions);
...@@ -75,10 +87,21 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -75,10 +87,21 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
}); });
}; };
/**
* @public
* @method IsoMap#getLayerControl
*/
this.getLayerControl = function() { this.getLayerControl = function() {
return layerControl; return layerControl;
}; };
/**
* Draws the map into the div container referenced by the mDiv class attribute after getting the user's location.
* The estimated user location is used as an initial center of the map shown.
*
* @public
* @method IsoMap#locateAndDraw
*/
this.locateAndDraw = function() { this.locateAndDraw = function() {
var locator = new IpLocator(); var locator = new IpLocator();
locator.locateByIp(mapOptions.ipProvider, onLocationSuccess.bind(this), onLocationError.bind(this)); locator.locateByIp(mapOptions.ipProvider, onLocationSuccess.bind(this), onLocationError.bind(this));
...@@ -86,6 +109,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -86,6 +109,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
// Private methods // Private methods
/**
* @private
* @method IsoMap#addBingLayers
*/
function addBingLayers() { function addBingLayers() {
var apiKey = 'AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf', var apiKey = 'AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf',
bAerial, bAerial,
...@@ -110,6 +137,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -110,6 +137,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
return bAerial; return bAerial;
} }
/**
* @private
* @method IsoMap#addBlueMarbleLayers
*/
function addBlueMarbleLayers() { function addBlueMarbleLayers() {
if (!L.tileLayer) { if (!L.tileLayer) {
return; return;
...@@ -142,6 +173,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -142,6 +173,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
return openGeoOSM; return openGeoOSM;
} }
/**
* @private
* @method IsoMap#addGoogleLayers
*/
function addGoogleLayers() { function addGoogleLayers() {
var gPhysical, var gPhysical,
gStreet, gStreet,
...@@ -168,6 +203,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -168,6 +203,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
return gSatellite; return gSatellite;
} }
/**
* @private
* @method IsoMap#addOsmLayer
*/
function addOsmLayer() { function addOsmLayer() {
if (!L.tileLayer) { if (!L.tileLayer) {
return; return;
...@@ -183,6 +222,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -183,6 +222,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
return layerOsm; return layerOsm;
} }
/**
* @private
* @method IsoMap#addStamenLayer
*/
function addStamenLayer() { function addStamenLayer() {
if (!L.StamenTileLayer) { if (!L.StamenTileLayer) {
return; return;
...@@ -196,6 +239,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -196,6 +239,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
return layerStamen; return layerStamen;
} }
/**
* @private
* @method IsoMap#onLocationError
*/
function onLocationError(message) { function onLocationError(message) {
logger.info('Could not get GeoLocation', message); logger.info('Could not get GeoLocation', message);
logger.debug(' - will continue with default location'); logger.debug(' - will continue with default location');
...@@ -203,6 +250,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -203,6 +250,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
this.draw(); this.draw();
} }
/**
* @private
* @method IsoMap#onLocationSuccess
*/
function onLocationSuccess(location) { function onLocationSuccess(location) {
if (!location || !location.coords) { if (!location || !location.coords) {
logger.debug('Invalid geoLocation found... no coordinates returned!'); logger.debug('Invalid geoLocation found... no coordinates returned!');
...@@ -217,6 +268,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -217,6 +268,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
this.draw(); this.draw();
} }
/**
* @private
* @method IsoMap#warningIndicatorHide
*/
function warningIndicatorHide() { function warningIndicatorHide() {
if (wsWarningControl !== null) { if (wsWarningControl !== null) {
map.removeControl(wsWarningControl); map.removeControl(wsWarningControl);
...@@ -224,6 +279,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma ...@@ -224,6 +279,10 @@ define(['jQuery', 'leaflet', 'console', 'map/layer/bing','map/layer/google', 'ma
} }
} }
/**
* @private
* @method IsoMap#warningIndicatorShow
*/
function warningIndicatorShow() { function warningIndicatorShow() {
if (wsWarningControl === null) { if (wsWarningControl === null) {
wsWarningControl = new WsWarningControl(); wsWarningControl = new WsWarningControl();
......
/**
* @class Isochrone
*/
define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringUtils'], function($, L, logger, Configuration, StringUtils) { define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringUtils'], function($, L, logger, Configuration, StringUtils) {
function Isochrone(iMap) { function Isochrone(iMap) {
var isoMap = null; var isoMap = null;
...@@ -9,6 +12,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU ...@@ -9,6 +12,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU
// Public methods // Public methods
/**
* @public
* @method Isochrone#showLayers
*/
this.showLayers = function(requestData, bBoxLatLng) { this.showLayers = function(requestData, bBoxLatLng) {
var config = Configuration.getInstance(); var config = Configuration.getInstance();
if (layerMap === null) { if (layerMap === null) {
...@@ -24,6 +31,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU ...@@ -24,6 +31,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU
// Private methods // Private methods
/**
* @private
* @method Isochrone#addLayers
*/
function addLayers(requestData, clientConfig, baseUrl) { function addLayers(requestData, clientConfig, baseUrl) {
var layerCoverage = null, var layerCoverage = null,
layerEdge = null, layerEdge = null,
...@@ -80,6 +91,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU ...@@ -80,6 +91,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU
updateLayers(requestData); updateLayers(requestData);
} }
/**
* @private
* @method Isochrone#fitMap
*/
function fitMap(bBoxLatLng) { function fitMap(bBoxLatLng) {
var map = null; var map = null;
...@@ -90,6 +105,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU ...@@ -90,6 +105,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/stringU
} }
} }
/**
* @private
* @method Isochrone#updateLayers
*/
function updateLayers(requestData) { function updateLayers(requestData) {
if (layerMap === null) { if (layerMap === null) {
logger.warn('Can not update layers... no layers available (call addLayers first!)'); logger.warn('Can not update layers... no layers available (call addLayers first!)');
......
/**
* @class SearchExtender
*/
define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], function($, logger, Configuration, StringUtils) { define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], function($, logger, Configuration, StringUtils) {
function SearchExtender(m, callback) { function SearchExtender(m, callback) {
var callbackFn = null; var callbackFn = null;
...@@ -16,11 +19,19 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -16,11 +19,19 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
// Public methods // Public methods
/**
* @public
* @method SearchExtender#extendResult
*/
this.extendResult = function() { this.extendResult = function() {
appendMapListener(); appendMapListener();
appendSListeners(); appendStateListeners();
}; };
/**
* @public
* @method SearchExtender#setState
*/
this.setState = function(state) { this.setState = function(state) {
isActive = state; isActive = state;
...@@ -35,6 +46,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -35,6 +46,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
// Private methods // Private methods
/**
* @private
* @method SearchExtender#appendIconListener
*/
function appendIconListener(geosearchResultEl, datasetConfigs, pointArr) { function appendIconListener(geosearchResultEl, datasetConfigs, pointArr) {
logger.debug('Appending icon listeners for searchExtender'); logger.debug('Appending icon listeners for searchExtender');
...@@ -48,13 +63,21 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -48,13 +63,21 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
}); });
} }
/**
* @private
* @method SearchExtender#appendMapListener
*/
function appendMapListener() { function appendMapListener() {
logger.debug('Appending map listeners for searchExtender'); logger.debug('Appending map listeners for searchExtender');
map.on(geosearchEventName, onSearchResult.bind(this)); map.on(geosearchEventName, onSearchResult.bind(this));
} }
function appendSListeners() { /**
* @private
* @method SearchExtender#appendStateListeners
*/
function appendStateListeners() {
var fnDisable = self.setState.bind(this, false), var fnDisable = self.setState.bind(this, false),
fnEnable = self.setState.bind(this, true); fnEnable = self.setState.bind(this, true);
...@@ -64,6 +87,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -64,6 +87,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
$(document).on('websocket_open', fnEnable); $(document).on('websocket_open', fnEnable);
} }
/**
* @private
* @method SearchExtender#clearDatasetConfigTab
*/
function clearDatasetConfigTab() { function clearDatasetConfigTab() {
if (configIsochroneDiv === null) { if (configIsochroneDiv === null) {
return; return;
...@@ -73,6 +100,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -73,6 +100,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
configIsochroneDiv = null; configIsochroneDiv = null;
} }
/**
* @private
* @method SearchExtender#createDatasetConfigTab
*/
function createDatasetConfigTab(cfg) { function createDatasetConfigTab(cfg) {
var a = document.createElement('a'), var a = document.createElement('a'),
container1 = document.createElement('div'), container1 = document.createElement('div'),
...@@ -144,6 +175,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -144,6 +175,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
}; };
} }
/**
* @private
* @method SearchExtender#getDmaxSliderSteps
*/
function getDmaxSliderSteps() { function getDmaxSliderSteps() {
return [{ return [{
display: '1min', display: '1min',
...@@ -181,6 +216,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -181,6 +216,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
}]; }];
} }
/**
* @private
* @method SearchExtender#getDSetConfigs
*/
function getDSetConfigs(point) { function getDSetConfigs(point) {
var config = Configuration.getInstance(), var config = Configuration.getInstance(),
configCandidates = [], configCandidates = [],
...@@ -207,6 +246,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -207,6 +246,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
return configCandidates; return configCandidates;
} }
/**
* @private
* @method SearchExtender#onSearchResult
*/
function onSearchResult(data) { function onSearchResult(data) {
var dSetConfigs = null, var dSetConfigs = null,
liFirstChild, liFirstChild,
...@@ -237,6 +280,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -237,6 +280,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
appendIconListener(geosearchResultEl, dSetConfigs, [data.point]); appendIconListener(geosearchResultEl, dSetConfigs, [data.point]);
} }
/**
* @private
* @method SearchExtender#showIsochroneConfig
*/
function showIsochroneConfig(geosearchResultEl, datasetConfigs, pointArr) { function showIsochroneConfig(geosearchResultEl, datasetConfigs, pointArr) {
// we write the datasetconfigs to a map while creating the config tabs, so // we write the datasetconfigs to a map while creating the config tabs, so
// that they can easily be retrieved on start button click // that they can easily be retrieved on start button click
...@@ -290,6 +337,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f ...@@ -290,6 +337,10 @@ define(['jQueryUI', 'console', 'isochrone/configuration', 'util/stringUtils'], f
}); });
} }
/**
* @private
* @method SearchExtender#sortDatasetFn
*/
function sortDatasetFn(d0, d1) { function sortDatasetFn(d0, d1) {
var s0 = d0.bBox.getSize(), var s0 = d0.bBox.getSize(),
s1 = d1.bBox.getSize(); s1 = d1.bBox.getSize();
......
/** /**
* GeoSearch - search for an address and zoom to its location * GeoSearch - search for an address and zoom to its location.
* *
* @see https://github.com/smeijer/leaflet.control.geosearch * @see https://github.com/smeijer/leaflet.control.geosearch
*/ */
......
/** /**
* Uses openstreetmap geocoding service for providing geosearch * Uses openstreetmap geocoding service for providing geosearch.
* *
* @see https://github.com/smeijer/leaflet.control.geosearch * @see https://github.com/smeijer/leaflet.control.geosearch
*/ */
......
/**
* @class ServiceConfiguration
*/
define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtils'], function($, L, logger, Configuration, GeoUtils) { define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtils'], function($, L, logger, Configuration, GeoUtils) {
function ServiceConfiguration(ws) { function ServiceConfiguration(ws) {
var actionName = 'getConfiguration'; var actionName = 'getConfiguration';
...@@ -9,6 +12,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtil ...@@ -9,6 +12,10 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtil
// Public methods // Public methods
/**
* @public
* @method ServiceConfiguration#initFromServer
*/
this.initFromServer = function() { this.initFromServer = function() {
// if (!$._data(document, 'events')[actionName]) { // if (!$._data(document, 'events')[actionName]) {
$(document).on(actionName, onServerResponse.bind(this)); $(document).on(actionName, onServerResponse.bind(this));
...@@ -29,6 +36,9 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtil ...@@ -29,6 +36,9 @@ define(['jQuery', 'leaflet', 'console', 'isochrone/configuration', 'util/geoUtil
* <li>queryNode the a 2D-coordinate of the query point</li> * <li>queryNode the a 2D-coordinate of the query point</li>
* <li>time the arrival or departure time of the query point</li> * <li>time the arrival or departure time of the query point</li>
* </ul> * </ul>
*
* @private
* @method ServiceConfiguration#onServerResponse
*/ */
function onServerResponse(data) { function onServerResponse(data) {
var config = Configuration.getInstance(), var config = Configuration.getInstance(),
......
/**
* @class ServiceIsochrone
*/
define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/geoUtils'], function($, L, logger, Spinner, Isochrone, GeoUtils) { define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/geoUtils'], function($, L, logger, Spinner, Isochrone, GeoUtils) {
function ServiceIsochrone(ws, iMap) { function ServiceIsochrone(ws, iMap) {
var actionName = 'getIsochrone'; var actionName = 'getIsochrone';
...@@ -11,6 +14,11 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/ ...@@ -11,6 +14,11 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/
websocket = ws; websocket = ws;
// Public methods // Public methods
/**
* @public
* @method ServiceIsochrone#sentRequest
*/
this.sentRequest = function(datasetConfig, points, options) { this.sentRequest = function(datasetConfig, points, options) {
var msg = null, var msg = null,
settings = $('#settings-fields'), settings = $('#settings-fields'),
...@@ -56,6 +64,10 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/ ...@@ -56,6 +64,10 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/
// Private methods // Private methods
/**
* @private
* @method ServiceIsochrone#onServerResponse
*/
function onServerResponse(requestData, responseData) { function onServerResponse(requestData, responseData) {
logger.debug('Handling event "' + actionName + '":', responseData); logger.debug('Handling event "' + actionName + '":', responseData);
logger.debug('Isochrone timings are: ', responseData.logging); logger.debug('Isochrone timings are: ', responseData.logging);
...@@ -84,6 +96,10 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/ ...@@ -84,6 +96,10 @@ define(['jQuery', 'leaflet', 'console', 'spinner', 'isochrone/isochrone', 'util/
$(document).off(actionName); $(document).off(actionName);
} }
/**
* @private
* @method ServiceIsochrone#pointsToQueryNodes
*/
function pointsToQueryNodes(points) { function pointsToQueryNodes(points) {
var i = 0, var i = 0,
nodes = []; nodes = [];
......
/**
* @class Websocket
*/
define(['jQuery', 'console'], function($, logger) { define(['jQuery', 'console'], function($, logger) {
// Static fields // Static fields
var currentUrl = window.location.href, var currentUrl = window.location.href,
...@@ -8,11 +11,11 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -8,11 +11,11 @@ define(['jQuery', 'console'], function($, logger) {
/** /**
* This class is used to communicate with the server * Used to communicate with the server.
*/ */
function Websocket() { function Websocket() {
/** /**
* The websocket object that holds the connection and to which the callback listeners are applied * The websocket object that holds the connection and to which the callback listeners are applied.
*/ */
var websocket = null; var websocket = null;
...@@ -27,9 +30,11 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -27,9 +30,11 @@ define(['jQuery', 'console'], function($, logger) {
// Public methods // Public methods
/** /**
* Sends the specified message to the server * Sends the specified message to the server.
* *
* @param msg {String/Object} message to send * @public
* @method Websocket#sendWsMessage
* @param {String/Object} msg message to send
*/ */
this.sendWsMessage = function(/* {String/Object} */msg) { this.sendWsMessage = function(/* {String/Object} */msg) {
if (websocket.readyState === websocket.OPEN) { if (websocket.readyState === websocket.OPEN) {
...@@ -51,6 +56,10 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -51,6 +56,10 @@ define(['jQuery', 'console'], function($, logger) {
// Private methods // Private methods
/**
* @private
* @method Websocket#onOpen
*/
function onOpen(evt) { function onOpen(evt) {
var e = null; var e = null;
...@@ -60,6 +69,10 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -60,6 +69,10 @@ define(['jQuery', 'console'], function($, logger) {
$(document).trigger(e); $(document).trigger(e);
} }
/**
* @private
* @method Websocket#onClose
*/
function onClose(evt) { function onClose(evt) {
var e = null; var e = null;
...@@ -69,6 +82,10 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -69,6 +82,10 @@ define(['jQuery', 'console'], function($, logger) {
$(document).trigger(e); $(document).trigger(e);
} }
/**
* @private
* @method Websocket#onMessage
*/
function onMessage(evt) { function onMessage(evt) {
var e1 = null, var e1 = null,
e2 = null, e2 = null,
...@@ -99,6 +116,10 @@ define(['jQuery', 'console'], function($, logger) { ...@@ -99,6 +116,10 @@ define(['jQuery', 'console'], function($, logger) {
$(document).trigger(e2); $(document).trigger(e2);
} }
/**
* @private
* @method Websocket#onError
*/
function onError(evt) { function onError(evt) {
var e = null; var e = null;
......
/**
* @class GeoUtils
*/
define(['leaflet'], function(L) { define(['leaflet'], function(L) {
/**
* @private
* @constructor
*/
function GeoUtils() { function GeoUtils() {
} }
// Public static method // Public static method
/** /**
* Converts from a LatLng (EPSG:4326) to a point from projection EPSG:3857 * Converts from a LatLng (EPSG:4326) to a point from projection EPSG:3857.
* *
* @param L.latLng the matching L.latLng object (coordinates in EPSG:4326) * @public
* @return L.Point the point to convert (containing EPSG:3857 x and y) * @method GeoUtils.convertFromLatLng
* @param {L.latLng} latLng the matching L.latLng object (coordinates in EPSG:4326)
* @return {L.Point} the point to convert (containing EPSG:3857 x and y)
*/ */
GeoUtils.convertFromLatLng = function(latLng) { GeoUtils.convertFromLatLng = function(latLng) {
return L.CRS.EPSG3857.project(latLng); return L.CRS.EPSG3857.project(latLng);
}; };
/** /**
* Converts a point from projection EPSG:3857 to LatLng (EPSG:4326) * Converts a point from projection EPSG:3857 to LatLng (EPSG:4326).
* *
* @public
* @method GeoUtils.convertToLatLng
* @param {L.Point} point the point to convert (containing EPSG:3857 x and y)
* @return {L.latLng} the matching L.latLng object (coordinates in EPSG:4326)
* @see http://developer.tomtom.com/docs/read/map_toolkit/javascript_sdk_2_0/Migration_Guide * @see http://developer.tomtom.com/docs/read/map_toolkit/javascript_sdk_2_0/Migration_Guide
* @param L.Point the point to convert (containing EPSG:3857 x and y)
* @return L.latLng the matching L.latLng object (coordinates in EPSG:4326)
*/ */
GeoUtils.convertToLatLng = function(point) { GeoUtils.convertToLatLng = function(point) {
var earthRadius = 6378137; var earthRadius = 6378137;
......
/**
* @class StringUtils
*/
define([], function() { define([], function() {
/**
* @private
* @constructor
*/
function StringUtils() { function StringUtils() {
} }
...@@ -7,13 +14,23 @@ define([], function() { ...@@ -7,13 +14,23 @@ define([], function() {
/** /**
* Takes a string and returns it with the first char in upper case and all the rest in lower case. * Takes a string and returns it with the first char in upper case and all the rest in lower case.
* *
* @param str string to capitalize * @public
* @returns same as the input, but with first letter in uppercase (and rest in lower case) * @method StringUtils.capitalize
* @param {String} str string to capitalize
* @return {String} same as the input, but with first letter in uppercase (and rest in lower case)
*/ */
StringUtils.capitalize = function(str) { StringUtils.capitalize = function(str) {
return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase(); return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase();
}; };
/**
* Converts a given date to a string (using pattern dd.mm.yyyy).
*
* @public
* @method StringUtils.dateToString
* @param {Date} the date to convert
* @return {String} the given date as string (using pattern dd.mm.yyyy)
*/
StringUtils.dateToString = function(date) { StringUtils.dateToString = function(date) {
var dateStr = ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear(), var dateStr = ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear(),
timeStr = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2); timeStr = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment