Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

New Post: Is Map.ExtendBuffer completely bugged or am I being stupid?

$
0
0
I turned on Map.ExtendBuffer, and now everything is screwed up. Pixel dont project correctly anymore and panning and zooming is impossible.

I tried to find the bug, and I found this:

ProjExt.cs
        public static Coordinate PixelToProj(this IProj self, Point position)
        {
            double x = Convert.ToDouble(position.X);
            double y = Convert.ToDouble(position.Y);
            if (self != null && self.GeographicExtents != null)
            {
                x = x * self.GeographicExtents.Width / self.ImageRectangle.Width + self.GeographicExtents.MinX;
                y = self.GeographicExtents.MaxY - y * self.GeographicExtents.Height / self.ImageRectangle.Height;
            }
            return new Coordinate(x, y, 0.0);
        }
But self.GeographicExtents has the width of the buffer, and not of the map display...

Also, self.ImageRectangle is the map display pixels divided by 3, which I dont get either...

Please, am I going insane? How does the math add up here...

I have no idea where to start fixing this either...

Thx for help.

Viewing all articles
Browse latest Browse all 3973

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>