XDL TIP

XDL Tip 게시판입니다.  

*** XDL을 다운 받으신 후 테스트가 가능합니다. 

*** Tutorial을 이용해 다양한 기능을 구현해보시기 바랍니다.

[NXPlanet] PlanetView 2D에서 화면에 도시되는 데이터의 레벨을 계산하는 방법

작성자
pixoneer
작성일
2019-03-15 14:11
조회
58
int nTileSize = 256;

Pixoneer.NXDL.XVertex3d pos1 = nxPlanetView1.ScreenToWorld(0.0, 0.0);
Pixoneer.NXDL.XVertex3d pos2 = nxPlanetView1.ScreenToWorld(nTileSize*0.9, 0.0);
double dist = (pos1-pos2).Length;

double coverRange1Tile = 18.0;

if (nxPlanetView1.Planet2DProjection == Pixoneer.NXDL.NXPlanet.NXPlanetView.ePlanet2DProjection.WebMercator)
{
pos1 = (Pixoneer.NXDL.XGeoPoint.FromDegree(0.0, 0.0, 0.0)).wm;
pos2 = (Pixoneer.NXDL.XGeoPoint.FromDegree(coverRange1Tile , 0.0, 0.0)).wm;
}
else
{
pos1 = (Pixoneer.NXDL.XGeoPoint.FromDegree(0.0, 0.0, 0.0)).eec;
pos2 = (Pixoneer.NXDL.XGeoPoint.FromDegree(coverRange1Tile , 0.0, 0.0)).eec;
}

double distTile = (pos1-pos2).Length;
int nLevel = 0;
while (distTile > dist)
{
nLevel++;
dist *= 2.0;
if (dist == 0.0)
break;
}
nLevel -= 1;
if (nLevel < 0) nLevel=0;

System.Diagnostics.Debug.WriteLine("Calc Level : {0}", nLevel.ToString());
전체 0