var WebUIPath = "../webui/v{0}_{1}_{2}/" var WebAPI = { webApiPath: "https://tlshosted.fleetcomplete.com/Authentication/v9/authentication.svc/", Authentication: { path: function() { return "https://tlshosted.fleetcomplete.com/Authentication/v9/authentication.svc/"; }, password: function (clientID, userLogin) { //"requestpassword/user?clientid={clientID}&userlogin={userlogin}" return this.path() + "requestpassword/user"; }, authenticate: function () { return this.path() + "Authenticate/user"; }, changepassword: function () { return this.path() + "changepassword/user"; } }, Asset: { path: function() { return WebAPI.webApiPath + "Asset.svc/"; }, assetDetail: function (assetID) { return this.path() + "assetDetail?assetId=" + assetID; }, assetCustomFields: function (assetID) { return this.path() + "?assetId=" + assetID; } }, Poi: { path: function() { return WebAPI.webApiPath + "Poi.svc/"; }, poiDetail: function (poiId) { return this.path() + "poiDetail?poiId=" + poiId; } }, User: { path: function () { return WebAPI.webApiPath; }, ChangePassword: function () { return this.path() + "ChangePassword/user?"; } }, Map: { path: function (path) { return WebAPI.webApiPath + "Map.svc/"; }, restagingVisibleItems: function () { return this.path() + "restagingVisibleItems?blah=" + Math.floor(Math.random() * 1000); }, getTiles: function(northWestLong, northWestLat, centerLong, centerLat, southEastLong, southEastLat, zoomLevel) { return this.path() + "getTiles?topleftlon=" + northWestLong.toString() + "&topleftlat=" + northWestLat.toString() + "¢erlon=" + centerLong.toString() + "¢erlat=" + centerLat.toString() + "&bottomrightlon=" + southEastLong.toString() + "&bottomrightlat=" + southEastLat.toString() + "&zoomLevel=" + zoomLevel; }, getPolygonItems: function(northWestLong, northWestLat, centerLong, centerLat, southEastLong, southEastLat, zoomLevel) { return this.path() + "getPolygonItems?topleftlon=" + northWestLong.toString() + "&topleftlat=" + northWestLat.toString() + "¢erlon=" + centerLong.toString() + "¢erlat=" + centerLat.toString() + "&bottomrightlon=" + southEastLong.toString() + "&bottomrightlat=" + southEastLat.toString() + "&zoomLevel=" + zoomLevel + "&clientId=" + getClientID() + "&userId=" + getUserID(); }, getMapItems: function(quadKey) { return this.path() + "mapitems?quadkey=" + quadKey + "&clientId=" + getClientID() + "&userId=" + getUserID(); }, getAssetsInCurrentView: function (tlLat, tlLong, brLat, brLong, pntLat, pntLong) { return this.path() + "getAssetsInCurrentView?topLeftLat=" + tlLat + "&topLeftLong=" + tlLong + "&bottomRightLat=" + brLat + "&bottomRightLong=" + brLong + "&pointLat=" + pntLat + "&pointLong=" + pntLong; }, getClusteredMapItemDetails: function(quadKey) { return this.path() + "clusteredMapItemDetails?quadkey=" + quadKey + "&clientId=" + getClientID() + "&userId=" + getUserID(); }, searchByDescription: function(criteria) { if (criteria == null) { return this.path() + "searchByDescription"; } return this.path() + "searchByDescription?criteria=" + criteria; }, getLatestPosition: function(mapItemId) { return this.path() + "getLatestPosition?mapItemId=" + mapItemId; }, mapToAssetType : function(assetTypeId) { return this.path() + "mapToAssetType?typeId=" + assetTypeId; }, mapToResourceType : function(resourceTypeId) { return this.path() + "mapToResourceType?typeId=" + resourceTypeId; }, fullTextSearch: function(keyword) { // TODO: escape keyword if (keyword == null) { return this.path() + "fullTextSearch"; } return this.path() + "fullTextSearch?keyword=" + keyword + "&clientId=" + getClientID() + "&userId=" + getUserID(); } } }