Contents of /trunk/src/osm-gps-map-types.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (show annotations)
Fri May 21 19:28:16 2010 UTC (13 years, 11 months ago) by harbaum
File MIME type: text/plain
File size: 2546 byte(s)
Map widget update
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
2 /* vim:set et sw=4 ts=4 cino=t0,(0: */
3 /*
4 * osm-gps-map-types.h
5 * Copyright (C) Marcus Bauer 2008 <marcus.bauer@gmail.com>
6 * Copyright (C) John Stowers 2009 <john.stowers@gmail.com>
7 *
8 * Contributions by
9 * Everaldo Canuto 2009 <everaldo.canuto@gmail.com>
10 *
11 * osm-gps-map.c is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * osm-gps-map.c is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 * See the GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24
25 #ifndef _OSM_GPS_MAP_TYPES_H_
26 #define _OSM_GPS_MAP_TYPES_H_
27
28 #include <gdk/gdk.h>
29 #if USE_LIBSOUP22
30 #include <libsoup/soup.h>
31 #endif
32 #include "osm-gps-map.h"
33
34 #define TILESIZE 256
35 #define MAX_ZOOM 20
36 #define MIN_ZOOM 0
37
38 #define OSM_REPO_URI "http://tile.openstreetmap.org/#Z/#X/#Y.png"
39 #define OSM_MIN_ZOOM 1
40 #define OSM_MAX_ZOOM 18
41 #define OSM_IMAGE_FORMAT "png"
42
43 #define URI_MARKER_X "#X"
44 #define URI_MARKER_Y "#Y"
45 #define URI_MARKER_Z "#Z"
46 #define URI_MARKER_S "#S"
47 #define URI_MARKER_Q "#Q"
48 #define URI_MARKER_Q0 "#W"
49 #define URI_MARKER_YS "#U"
50 #define URI_MARKER_R "#R"
51
52 #define URI_HAS_X (1 << 0)
53 #define URI_HAS_Y (1 << 1)
54 #define URI_HAS_Z (1 << 2)
55 #define URI_HAS_S (1 << 3)
56 #define URI_HAS_Q (1 << 4)
57 #define URI_HAS_Q0 (1 << 5)
58 #define URI_HAS_YS (1 << 6)
59 #define URI_HAS_R (1 << 7)
60 //....
61 #define URI_FLAG_END (1 << 8)
62
63 /* equatorial radius in meters */
64 #define OSM_EQ_RADIUS (6378137.0)
65
66 typedef struct {
67 int x1;
68 int y1;
69 int x2;
70 int y2;
71 } bbox_pixel_t;
72
73 typedef struct {
74 /* The details of the tile to download */
75 char *uri;
76 char *folder;
77 char *filename;
78 OsmGpsMap *map;
79 /* whether to redraw the map when the tile arrives */
80 gboolean redraw;
81 #if USE_LIBSOUP22
82 SoupSession *session;
83 #endif
84 } tile_download_t;
85
86 typedef struct {
87 int x;
88 int y;
89 int zoom;
90 } tile_t;
91
92 typedef struct {
93 coord_t pt;
94 GdkPixbuf *image;
95 int w;
96 int h;
97 int xoffset;
98 int yoffset;
99 } image_t;
100
101 #endif /* _OSM_GPS_MAP_TYPES_H_ */