Beispiel #1
0
        public static LocalCoordinateProjection LocalCoordinateProjectionForTile(TileAddress address)
        {
            var origin = address.GetOriginMercatorMeters();
            var scale  = address.GetSizeMercatorMeters();

            return(delegate(double longitude, double latitude)
            {
                var lngLat = new LngLat(longitude, latitude);
                var meters = lngLat.ToMercatorMeters();
                var x = (meters.x - origin.x) / scale;
                var y = (meters.y - origin.y) / scale;
                return new Point((float)x, (float)y);
            });
        }