예제 #1
0
        static public latlong_area_class calc_latlong_area_by_tile(latlong_class latlong, tile_class tile, double zoom, int resolution, Vector2 bresolution, Vector2 offset)
        {
            float num = Mathf.Pow(2, (float)(19 - zoom));

            zoom         = 19;
            resolution   = (int)(resolution * num);
            bresolution *= num;
            latlong_area_class latlong_area_class = new latlong_area_class();
            map_pixel_class    map_pixel_class    = latlong_to_pixel2(latlong, zoom);
            Vector2            vector             = new Vector2(0, 0);

            map_pixel_class.x += tile.x * resolution + offset.x;
            map_pixel_class.y += tile.y * resolution + offset.y;
            if (tile.x > 0)
            {
                map_pixel_class.x += num;
                vector.x           = num;
            }
            if (tile.y > 0)
            {
                map_pixel_class.y += num;
                vector.y           = num;
            }
            latlong_class latlong_class = pixel_to_latlong2(map_pixel_class, zoom);

            latlong_area_class.latlong1 = latlong_class;
            map_pixel_class.x          += bresolution.x - vector.x;
            map_pixel_class.y          += bresolution.y - vector.y;
            latlong_class = pixel_to_latlong2(map_pixel_class, zoom);
            latlong_area_class.latlong2 = latlong_class;
            return(latlong_area_class);
        }
예제 #2
0
        static public latlong_area_class calc_latlong_area_by_tile2(latlong_class latlong, tile_class tile, double zoom, int resolution, Vector2 bresolution)
        {
            latlong_area_class latlong_area_class = new latlong_area_class();
            map_pixel_class    map_pixel_class    = latlong_to_pixel2(latlong, zoom);

            map_pixel_class.x += tile.x * resolution;
            map_pixel_class.y += tile.y * resolution;
            latlong_class latlong_class = pixel_to_latlong2(map_pixel_class, zoom);

            latlong_area_class.latlong1 = latlong_class;
            map_pixel_class.x          += bresolution.x;
            map_pixel_class.y          += bresolution.y;
            latlong_class = pixel_to_latlong2(map_pixel_class, zoom);
            latlong_area_class.latlong2 = latlong_class;
            return(latlong_area_class);
        }