고객지원

고객지원 > FAQ

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

작성자
pixoneer
작성일
2019-03-15 14:11
조회
2071
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

번호 제목 작성자 작성일 조회
1
Q&A 질문
작성자 픽소니어 작성일 2024.06.28 조회 5
픽소니어 2024.06.28 5