EarthSDK
    正在准备搜索索引...

    函数 parseRtsOrigin

    • 从 info 地址解析 origin(协议 + 主机 + 端口)。

      会先调用 resolveRtsInfoUrl 将相对路径转为完整 URL,再提取 origin 部分。

      参数

      • url: string

        RTS info 地址

      返回 undefined | string

      origin 字符串;解析失败返回 undefined

      parseRtsOrigin('http://localhost:9009/ts/info/ts01')  // => 'http://localhost:9009'
      parseRtsOrigin('/ts/info/ts01') // => 'http://localhost:29009'(取决于当前页面)