1

Is there a way to get actual top left and bottom right lat lng coordinates from Map.GetExtent() envelope to filter MSSql server database for the available shapes in the region?

I tried many things but was not able to achieve it.

double dleft = mbEarth.Map.Center.X - mbEarth.Map.Zoom * 0.00000525;
double dright = mbEarth.Map.Center.X + mbEarth.Map.Zoom * 0.00000525;
double dtop = mbEarth.Map.Center.Y + mbEarth.Map.Zoom * 0.00000525;
double dbottom = mbEarth.Map.Center.Y - mbEarth.Map.Zoom * 0.00000525;
    
string smapframegeom = $"POLYGON (({dleft} {dtop},{dright} {dtop},{dright} {dbottom},{dleft} {dbottom},{dleft} {dtop}))";
    
Envelope _env1 = mbEarth.Map.Envelope;
Coordinate _c01 = _env1.TopLeft();
Coordinate _c02 = _env1.TopRight();
Coordinate _c03 = _env1.BottomRight();
Coordinate _c04 = _env1.BottomLeft();

Envelope _env2 = mbEarth.Map.GetExtents();
Coordinate _c1 = _env2.TopLeft();
Coordinate _c2 = _env2.TopRight();
Coordinate _c3 = _env2.BottomRight();
Coordinate _c4 = _env2.BottomLeft();
Palle Due
  • 5,929
  • 4
  • 17
  • 32

0 Answers0