How to use the @esri/arcgis-rest-portal.getPortal function in @esri/arcgis-rest-portal

To help you get started, we’ve selected a few @esri/arcgis-rest-portal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / solution.js / packages / common / examples / convertExtent / src / main.ts View on Github external
return new Promise(resolve => {
    const usOptions: common.IUserSessionOptions = {};
    const authorization: common.UserSession = new common.UserSession(usOptions);

    // Get the extents of a portal
    // tslint:disable-next-line: no-floating-promises
    portal
      .getPortal(portalId, { authentication: authorization })
      .then(portalResponse => {
        const portalExtent: any = portalResponse.defaultExtent;
        let html = "";

        html += "<h4>Source extents</h4>";
        if (!portalId) {
          html += "<i>Using sample extents</i><br>";
        }
        html += "<pre>" + JSON.stringify(portalExtent, null, 4) + "</pre>";

        // Convert the extents
        const outSR: restTypes.ISpatialReference = { wkid: 4326 };
        const geometryServiceUrl: string =
          "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer";
        // tslint:disable-next-line: no-floating-promises
github Esri / solution.js / packages / common / src / restHelpersGet.ts View on Github external
export function getPortal(
  id: string,
  authentication: interfaces.UserSession
): Promise {
  const requestOptions = {
    authentication: authentication
  };
  return portal.getPortal(id, requestOptions);
}