How to use the @nextgis/utils.fixUrlStr function in @nextgis/utils

To help you get started, we’ve selected a few @nextgis/utils 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 nextgis / nextgisweb_frontend / packages / qms-kit / src / utility.ts View on Github external
return new Promise((resolve, reject) => {
    const xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = () => {
      if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
        if (xmlHttp.responseText) {
          try {
            resolve(JSON.parse(xmlHttp.responseText));
          } catch (er) {
            reject(er);
          }
        }
      }
    };
    xmlHttp.open('GET', fixUrlStr(url), true); // true for asynchronous
    xmlHttp.send();
  });
}
github nextgis / nextgisweb_frontend / packages / ngw-kit / src / WebMapLayerAdapter.ts View on Github external
private _updateItemsParams(item: TreeGroup | TreeLayer, webMap: WebMap, data: ResourceItem) {
    if (item) {
      if (item.item_type === 'group' || item.item_type === 'root') {
        if (item.children) {
          item.children = item.children.map(x => this._updateItemsParams(x, webMap, data));
        }
        if (item.item_type === 'root') {
          item.display_name = data.resource.display_name;
        }
      } else if (item.item_type === 'layer') {
        const url = fixUrlStr(this.options.baseUrl + '/api/component/render/image');
        const resourceId = item.layer_style_id;
        item.url = url;
        item.resourceId = resourceId;
        item.updateWmsParams = params => updateWmsParams(params, resourceId);
        item = {
          ...item,
          ...getLayerAdapterOptions(
            {
              adapter: item.layer_adapter.toUpperCase() as NgwLayerAdapterType,
              resourceId
            },
            webMap,
            this.options.baseUrl
          )
        };
      }

@nextgis/utils

Common development tools

MIT
Latest version published 8 days ago

Package Health Score

76 / 100
Full package analysis

Popular @nextgis/utils functions