public override IEnumerator RunJob()
        {
            Debug.Log("*************************** CoroutineJobLoadMap ***************************");

            BaseMapper    mapper = host as BaseMapper;
            SDKMapRequest r      = new SDKMapRequest();

            r.token = mapper.token;
            r.id    = this.id;

            string jsonString2 = JsonUtility.ToJson(r);

            using (UnityWebRequest request = UnityWebRequest.Put(string.Format(Endpoint.URL_FORMAT, mapper.server, Endpoint.LOAD_MAP), jsonString2))
            {
                request.method          = UnityWebRequest.kHttpVerbPOST;
                request.useHttpContinue = false;
                request.SetRequestHeader("Content-Type", "application/json");
                request.SetRequestHeader("Accept", "application/json");
                yield return(request.SendWebRequest());

                //Debug.Log("Response code: " + request.responseCode);

                if (request.isNetworkError || request.isHttpError)
                {
                    Debug.LogError(request.error);
                }
                else if (request.responseCode == (long)HttpStatusCode.OK)
                {
                    SDKMapResult result = JsonUtility.FromJson <SDKMapResult>(request.downloadHandler.text);
                    if (result.error == "none")
                    {
                        byte[] mapData = Convert.FromBase64String(result.b64);
                        Debug.Log("Load map " + this.id + " (" + mapData.Length + " bytes) (" + MD5(mapData) + "/" + result.md5_al + ")");

                        uint      countMax     = 16 * 1024;
                        Vector3[] vector3Array = new Vector3[countMax];

                        Task <int> t0 = Task.Run(() =>
                        {
                            return(Immersal.Core.LoadMap(mapData));
                        });

                        while (!t0.IsCompleted)
                        {
                            yield return(null);
                        }

                        int mapId = t0.Result;

                        Debug.Log("mapId " + mapId);

                        Task <int> t1 = Task.Run(() =>
                        {
                            return(Immersal.Core.GetPointCloud(mapId, vector3Array));
                        });

                        while (!t1.IsCompleted)
                        {
                            yield return(null);
                        }

                        int num = t1.Result;

                        Debug.Log("map points: " + num);

                        PointCloudRenderer renderer = go.AddComponent <PointCloudRenderer>();
                        renderer.CreateCloud(vector3Array, num);
                        renderer.mapId = mapId;
                        if (!mapper.pcr.ContainsKey(id))
                        {
                            mapper.pcr.Add(id, renderer);
                        }

                        mapper.stats.locFail = 0;
                        mapper.stats.locSucc = 0;

                        VisualizeManager.loadJobs.Remove(mapId);
                    }
                }
            }
        }
		public override IEnumerator RunJob()
		{
			Debug.Log("*************************** CoroutineJobLoadMap ***************************");
			SDKMapRequest r = new SDKMapRequest();
			r.token = this.token;
			r.id = this.id;

			string jsonString2 = JsonUtility.ToJson(r);
			using (UnityWebRequest request = UnityWebRequest.Put(string.Format(URL_FORMAT, this.server, "3"), jsonString2))
			{
				request.method = UnityWebRequest.kHttpVerbPOST;
				request.useHttpContinue = false;
				request.SetRequestHeader("Content-Type", "application/json");
				request.SetRequestHeader("Accept", "application/json");
				yield return request.SendWebRequest();

				//Debug.Log("Response code: " + request.responseCode);

				if (request.isNetworkError || request.isHttpError)
				{
					Debug.Log(request.error);
				}
				else if (request.responseCode == (long)HttpStatusCode.OK)
				{
					SDKMapResult result = JsonUtility.FromJson<SDKMapResult>(request.downloadHandler.text);
					if (result.error == "none")
					{

						byte[] mapData = Convert.FromBase64String(result.b64);
						Debug.Log("Load map " + this.id + " (" + mapData.Length + " bytes)");

						uint countMax = 16*1024;
						Vector3[] vector3Array = new Vector3[countMax];

                        Task<int> t0 = Task.Run(() =>
                        {
                            return Immersal.Core.LoadMap(mapData);
                        });
                         
                        while (!t0.IsCompleted)
                        {
                            yield return null;
                        }

                        int handle = t0.Result;

                        Debug.Log("handle " + handle);

                        Task<int> t1 = Task.Run(() =>
                        {
                            return Immersal.Core.GetPointCloud(handle, vector3Array);
                        });

                        while (!t1.IsCompleted)
                        {
                            yield return null;
                        }

                        int num = t1.Result;

						Debug.Log("map points: " + num);

						PointCloudRenderer renderer = go.AddComponent<PointCloudRenderer>();
						renderer.CreateCloud(vector3Array, num);
						renderer.handle = handle;
						pcr.Add(id, renderer);

                        stats.locFail = 0;
						stats.locSucc = 0;
					}
				}
			}

		}