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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (hide annotations)
Tue Jul 28 13:21:22 2009 UTC (14 years, 9 months ago) by harbaum
File MIME type: text/plain
File size: 4835 byte(s)
osm-gps-map integration
1 harbaum 32 /* -*- 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.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_H_
26     #define _OSM_GPS_MAP_H_
27    
28     #include <glib.h>
29     #include <glib-object.h>
30     #include <gtk/gtk.h>
31     #include <gdk-pixbuf/gdk-pixbuf.h>
32    
33     G_BEGIN_DECLS
34    
35     #define OSM_TYPE_GPS_MAP (osm_gps_map_get_type ())
36     #define OSM_GPS_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSM_TYPE_GPS_MAP, OsmGpsMap))
37     #define OSM_GPS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OSM_TYPE_GPS_MAP, OsmGpsMapClass))
38     #define OSM_IS_GPS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSM_TYPE_GPS_MAP))
39     #define OSM_IS_GPS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSM_TYPE_GPS_MAP))
40     #define OSM_GPS_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OSM_TYPE_GPS_MAP, OsmGpsMapClass))
41    
42     typedef struct _OsmGpsMapClass OsmGpsMapClass;
43     typedef struct _OsmGpsMap OsmGpsMap;
44     typedef struct _OsmGpsMapPrivate OsmGpsMapPrivate;
45    
46     struct _OsmGpsMapClass
47     {
48     GtkDrawingAreaClass parent_class;
49     };
50    
51     struct _OsmGpsMap
52     {
53     GtkDrawingArea parent_instance;
54     OsmGpsMapPrivate *priv;
55     };
56    
57     typedef struct {
58     float rlat;
59     float rlon;
60     } coord_t;
61    
62     //http://www.internettablettalk.com/forums/showthread.php?t=5209
63     //https://garage.maemo.org/plugins/scmsvn/viewcvs.php/trunk/src/maps.c
64     //http://www.ponies.me.uk/maps/GoogleTileUtils.java
65     //http://www.mgmaps.com/cache/MapTileCacher.perl
66     #define MAP_SOURCE_OPENSTREETMAP "http://tile.openstreetmap.org/#Z/#X/#Y.png"
67     #define MAP_SOURCE_OPENSTREETMAP_RENDERER "http://tah.openstreetmap.org/Tiles/tile/#Z/#X/#Y.png"
68     #define MAP_SOURCE_OPENAERIALMAP "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z/#X/#Y.jpg"
69     #define MAP_SOURCE_GOOGLE_MAPS "http://mt#R.google.com/mt?x=#X&y=#Y&zoom=#S"
70     //No longer working
71     //#define MAP_SOURCE_GOOGLE_HYBRID "http://mt#R.google.com/mt?n=404&v=w2t.99&x=#X&y=#Y&zoom=#S"
72     #define MAP_SOURCE_GOOGLE_HYBRID "http://mt#R.google.com/mt?x=#X&y=#Y&zoom=#S"
73     #define MAP_SOURCE_GOOGLE_SATTELITE "http://khm#R.google.com/kh?n=404&v=32&x=#X&y=#Y&z=#Z"
74     #define MAP_SOURCE_GOOGLE_SATTELITE_QUAD "http://khm#R.google.com/kh?n=404&v=3&t=#Q"
75     #define MAP_SOURCE_MAPS_FOR_FREE "http://maps-for-free.com/layer/relief/z#Z/row#Y/#Z_#X-#Y.jpg"
76     #define MAP_SOURCE_VIRTUAL_EARTH_SATTELITE "http://a#R.ortho.tiles.virtualearth.net/tiles/a#W.jpeg?g=50"
77    
78     GType osm_gps_map_get_type (void) G_GNUC_CONST;
79     void osm_gps_map_download_maps (OsmGpsMap *map, coord_t *pt1, coord_t *pt2, int zoom_start, int zoom_end);
80     void osm_gps_map_get_bbox (OsmGpsMap *map, coord_t *pt1, coord_t *pt2);
81     void osm_gps_map_set_mapcenter (OsmGpsMap *map, float latitude, float longitude, int zoom);
82     void osm_gps_map_set_center (OsmGpsMap *map, float latitude, float longitude);
83     int osm_gps_map_set_zoom (OsmGpsMap *map, int zoom);
84     void osm_gps_map_add_track (OsmGpsMap *map, GSList *track);
85     void osm_gps_map_clear_tracks (OsmGpsMap *map);
86     void osm_gps_map_add_image (OsmGpsMap *map, float latitude, float longitude, GdkPixbuf *image);
87     void osm_gps_map_clear_images (OsmGpsMap *map);
88     void osm_gps_map_osd_speed (OsmGpsMap *map, float speed);
89     void osm_gps_map_draw_gps (OsmGpsMap *map, float latitude, float longitude, float heading);
90     void osm_gps_map_clear_gps (OsmGpsMap *map);
91     coord_t osm_gps_map_get_co_ordinates (OsmGpsMap *map, int pixel_x, int pixel_y);
92     GtkWidget * osm_gps_map_new(void);
93     void osm_gps_map_screen_to_geographic (OsmGpsMap *map,
94     gint pixel_x, gint pixel_y,
95     gfloat *latitude, gfloat *longitude);
96     void osm_gps_map_geographic_to_screen (OsmGpsMap *map,
97     gfloat latitude, gfloat longitude,
98     gint *pixel_x, gint *pixel_y);
99     void osm_gps_map_scroll (OsmGpsMap *map, gint dx, gint dy);
100    
101     G_END_DECLS
102    
103     #endif /* _OSM_GPS_MAP_H_ */