10
10
#include <navit/command.h>
11
11
#include <navit/config_.h>
12
12
#include <navit/transform.h>
13
+ #include <navit/network.h>
13
14
14
15
#include "gui_internal.h"
15
16
#include "coord.h"
18
19
#include "gui_internal_widget.h"
19
20
#include "gui_internal_priv.h"
20
21
#include "gui_internal_map_downloader.h"
21
- #include "network .h"
22
+ #include "cJSON .h"
22
23
#include <pthread.h>
24
+ #include <stdio.h>
25
+ #include <string.h>
23
26
24
27
pthread_t dl_thread ;
25
28
struct map_download_info dl_info ;
@@ -30,10 +33,10 @@ struct map_download_info dl_info;
30
33
*
31
34
* @param the navit object from which we can fetch the mapset to enable
32
35
*
33
- * @returns Returns mapset_add_attr() result
36
+ * @returns nothing
34
37
*/
35
38
36
- int enable_map (struct navit * navit , char * map_path ) {
39
+ void enable_map (struct navit * navit , char * map_path ) {
37
40
int ret ;
38
41
struct attr attr ;
39
42
@@ -60,11 +63,11 @@ int enable_map(struct navit *navit, char * map_path) {
60
63
struct attr map_a ;
61
64
map_a .type = attr_map ;
62
65
map_a .u .map = new_map ;
66
+ map_a .u .data = NULL ;
63
67
ret = mapset_add_attr (ms , & map_a );
64
68
dbg (lvl_error , "Enabled map %s with result %i\n" , map_path , ret );
65
69
navit_draw (navit );
66
70
}
67
- return ret ;
68
71
}
69
72
70
73
@@ -145,12 +148,15 @@ void gui_internal_map_downloader(struct gui_priv *this, struct widget *wm, void
145
148
} else {
146
149
dbg (lvl_error , "Download will be started\n" );
147
150
strcpy (dl_info .url ,
148
- g_strdup_printf ("http ://www.navit-project.org/maps/osm_bbox_11.3,47.9,11.7,48.2.osm.bz2 " ));
151
+ g_strdup_printf ("https ://github.com/jkoan/gh-actions-mapserver/releases/download/2021-07-21/europe-germany-thueringen-2021-07-21.bin " ));
149
152
strcpy (dl_info .url ,
150
- g_strdup_printf ("http ://maps9.navit-project.org/api/map/?bbox=-125.94,32.43,-114.08,42.07×tamp=161223 " ));
153
+ g_strdup_printf ("https ://github.com/jkoan/gh-actions-mapserver/releases/download/2021-07-21/europe-germany-schleswig-holstein-2021-07-21.bin " ));
151
154
strcpy (dl_info .url ,
152
- g_strdup_printf ("http://maps9.navit-project.org/api/map/?bbox=-123.7,36.9,-120.5,38.7×tamp=161223" ));
153
- dl_info .name = g_strdup ("west.bin" );
155
+ g_strdup_printf ("https://github.com/jkoan/gh-actions-mapserver/releases/download/2021-07-21/australia-oceania-cook-islands-2021-07-21.bin" ));
156
+ gchar * ret ;
157
+
158
+ ret = g_strrstr (dl_info .url , "/" );
159
+ dl_info .name = g_strdup (++ ret );
154
160
dl_info .path = g_strjoin (NULL , getenv ("NAVIT_SHAREDIR" ), "/maps/" , dl_info .name , NULL );
155
161
dl_info .xml = g_strjoin (NULL , getenv ("NAVIT_SHAREDIR" ), "/maps/" , dl_info .name , ".xml" , NULL );
156
162
dbg (lvl_error ," %s -> %s %s\n" , dl_info .url , dl_info .name , dl_info .path );
0 commit comments