]> mj.ucw.cz Git - leo.git/blob - map.h
2fa4f89bbbc6d1b2c94c309eae09d716f556d328
[leo.git] / map.h
1 /*
2  *      Hic Est Leo -- Global Map Operations
3  *
4  *      (c) 2014 Martin Mares <mj@ucw.cz>
5  */
6
7 #ifndef _LEO_MAP_H
8 #define _LEO_MAP_H
9
10 #include "svg.h"
11
12 /* Map configuration */
13
14 extern double map_min_x, map_min_y;
15 extern double map_max_x, map_max_y;
16 extern double page_width, page_height;
17 extern uns map_clip, map_rotate, map_draw_border;
18 extern char *map_projection;
19 extern char *map_svg_output;
20
21 // Remember to update map.c:map_formats
22 enum data_source_type {
23   DATA_SOURCE_INVALID,
24   DATA_SOURCE_OSMXML,
25   DATA_SOURCE_FIXED,
26 };
27
28 struct data_source {
29   cnode n;
30   // Configuration
31   char *file;
32   int format;
33   clist styles;         // of data_source_style
34   // Runtime
35   struct osm *osm;
36 };
37
38 struct data_source_style {
39   cnode n;
40   // Configuration
41   char *name;
42   // Runtime
43   struct css_sheet *css;
44 };
45
46 extern clist map_sources;
47
48 /* Calculated by map_set_scale() */
49
50 extern double map_scale;
51 extern double page_offset_x, page_offset_y;
52 extern double page_map_width, page_map_height;
53
54 void map_set_scale(void);
55 bool map_object_visible_p(struct osm_object *o);
56
57 void map_load_styles(void);
58 void map_load_sources(void);
59 void map_apply_styles(struct svg *svg);
60
61 #endif