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

    函数 checkAndConvertImage

    • 判断是否可用,若图片是相对路径会转换为绝对路径

      参数

      • relativeUrl: string

        图片地址

      • callback: (absoluteUrl: string, isAvailable: boolean) => void

        回调函数

      返回 void

      const relativeUrl: string = 'images/picture.jpg';
      checkAndConvertImage(relativeUrl, (absoluteUrl: string, isAvailable: boolean) => {
      if (isAvailable) {
      console.log('图片地址可用: ' + absoluteUrl);
      } else {
      console.log('图片地址不可用: ' + absoluteUrl);
      }
      });