UNPKG

@deltares/fews-ssd-requests

Version:

Library for making requests to the FEWS SSD webservice

24 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUrlForAction = void 0; /** * Get the url to retrieve a SSD actions for a specific object on a specific panel */ function getUrlForAction(actionRequest) { const clickType = actionRequest.clickType === undefined ? "LEFTSINGLECLICK" : actionRequest.clickType; let request = `?request=GetAction&ssd=${actionRequest.panelId}&action=${clickType}&objectid=${actionRequest.objectId}`; if (actionRequest.timeZero !== undefined) request += `&timezero=${actionRequest.timeZero}`; if (actionRequest.convertDatum !== undefined) request += `&convertDatum=${actionRequest.convertDatum}`; if (actionRequest.useDisplayUnits !== undefined) request += `&useDisplayUnits=${actionRequest.useDisplayUnits}`; if (actionRequest.options !== undefined) request += `&options=${actionRequest.options.join(',')}`; if (actionRequest.config !== false) request += `&config=true`; request += '&format=application/json'; return request; } exports.getUrlForAction = getUrlForAction; //# sourceMappingURL=getUrlForAction.js.map