本文整理汇总了C#中ITile.getTopLeft方法的典型用法代码示例。如果您正苦于以下问题:C# ITile.getTopLeft方法的具体用法?C# ITile.getTopLeft怎么用?C# ITile.getTopLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITile
的用法示例。
在下文中一共展示了ITile.getTopLeft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: toPixelLocationPrint
public override Point toPixelLocationPrint(GeoCoord loc, ITile tile)
{
int xx = 0;
int yy = 0;
if(tile != null)
{
// the idea here is to simplify conversion for tiles around 180, when camera operates
// on coordinates above 180 and below -180
int offsetX = 0;
int offsetY = 0;
Point offset;
if(!(offset=tile.getOffset()).IsEmpty)
{
offsetX = offset.X;
offsetY = offset.Y;
}
GeoCoord tileTopLeft = tile.getTopLeft();
GeoCoord tileTopLeftN = tileTopLeft.Clone();
tileTopLeftN.Normalize();
GeoCoord locN = loc.Clone();
locN.Normalize();
double dOffsetLng = locN.Lng - tileTopLeftN.Lng;
double dOffsetLat = locN.Lat - tileTopLeftN.Lat;
xx = (int)Math.Round((tileTopLeft.Lng + dOffsetLng - m_coverageTopLeftPrint.Lng) / xScalePrint) + offsetX;
yy = (int)Math.Round((tileTopLeft.Lat + dOffsetLat - m_coverageTopLeftPrint.Lat) / yScalePrint) + offsetY;
}
else
{
// express location longitude and latitude in terms of camera coordinates:
double dOffsetLng = loc.Lng - m_location.Lng;
while(dOffsetLng >= 180.0d)
{
dOffsetLng -= 360.0d;
}
while(dOffsetLng <= -180.0d)
{
dOffsetLng += 360.0d;
}
if(TileSetTerra.This.hasRenderedTiles && TileSetTerra.This.insideCurrentZone(loc))
{
Point screenPt = TileSetTerra.This.toScreenPoint(loc, true);
screenPt.Offset(m_pictureManager.OffsetXPrint, m_pictureManager.OffsetYPrint);
return screenPt;
}
else
{
xx = (int)Math.Round(dOffsetLng / xScalePrint + pictureWidthPrint / 2.0d);
yy = (int)Math.Round((loc.Lat - m_location.Lat) / yScalePrint + pictureHeightPrint / 2.0d);
}
}
//LibSys.StatusBar.Trace("toPixelLocation(" + loc + ") x=" + xx + " y=" + yy);
Point ret = new Point(xx, yy);
ret.Offset(m_pictureManager.OffsetXPrint, m_pictureManager.OffsetYPrint);
return ret;
}
示例2: toPixelLocation
public override Point toPixelLocation(GeoCoord loc, ITile tile)
{
int xx = 0;
int yy = 0;
if(tile != null)
{
// the idea here is to simplify conversion for tiles around 180, when camera operates
// on coordinates above 180 and below -180
int offsetX = 0;
int offsetY = 0;
Point offset;
if(!(offset=tile.getOffset()).IsEmpty)
{
offsetX = offset.X;
offsetY = offset.Y;
}
GeoCoord tileTopLeft = tile.getTopLeft();
GeoCoord tileTopLeftN = tileTopLeft.Clone();
tileTopLeftN.Normalize();
GeoCoord locN = loc.Clone();
locN.Normalize();
double dOffsetLng = locN.Lng - tileTopLeftN.Lng;
double dOffsetLat = locN.Lat - tileTopLeftN.Lat;
xx = (int)Math.Round((tileTopLeft.Lng + dOffsetLng - m_coverageTopLeft.Lng) / xScale) + offsetX;
yy = (int)Math.Round((tileTopLeft.Lat + dOffsetLat - m_coverageTopLeft.Lat) / yScale) + offsetY;
return new Point(xx, yy);
}
else
{
// express location longitude and latitude in terms of camera coordinates:
double dOffsetLng = loc.Lng - m_location.Lng;
while(dOffsetLng >= 180.0d)
{
dOffsetLng -= 360.0d;
}
while(dOffsetLng <= -180.0d)
{
dOffsetLng += 360.0d;
}
double dOffsetLat = loc.Lat - m_location.Lat;
if(TileSetTerra.This.hasRenderedTiles && !TileSetTerra.This.RetilingSpecial && TileSetTerra.This.insideCurrentZone(loc) && insideScreenRectangle(loc))
{
Point screenPt = TileSetTerra.This.toScreenPoint(loc, false);
return screenPt;
}
else
{
xx = (int)Math.Round(dOffsetLng / xScale + pictureWidth / 2.0d);
yy = (int)Math.Round((loc.Lat - m_location.Lat) / yScale + pictureHeight / 2.0d);
return new Point(xx, yy);
}
}
}