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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 267 - (show annotations)
Thu Aug 13 19:08:30 2009 UTC (14 years, 9 months ago) by harbaum
File MIME type: text/plain
File size: 2538 byte(s)
Updated osm-gps-map
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 #ifdef 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 #define OSM_NAN (0.0/0.0)
64
65 /* equatorial radius in meters */
66 #define OSM_EQ_RADIUS (6378137.0)
67
68 typedef struct {
69 int x1;
70 int y1;
71 int x2;
72 int y2;
73 } bbox_pixel_t;
74
75 typedef struct {
76 /* The details of the tile to download */
77 char *uri;
78 char *folder;
79 char *filename;
80 OsmGpsMap *map;
81 /* whether to redraw the map when the tile arrives */
82 gboolean redraw;
83 #ifdef LIBSOUP22
84 SoupSession *session;
85 #endif
86 } tile_download_t;
87
88 typedef struct {
89 int x;
90 int y;
91 int zoom;
92 } tile_t;
93
94 typedef struct {
95 coord_t pt;
96 GdkPixbuf *image;
97 int w;
98 int h;
99 } image_t;
100
101 #endif /* _OSM_GPS_MAP_TYPES_H_ */