Add:Android:use and download 2 maps
authorzoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 19 Feb 2011 19:46:39 +0000 (19:46 +0000)
committerzoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 19 Feb 2011 19:46:39 +0000 (19:46 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4213 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/android/src/org/navitproject/navit/Navit.java
navit/navit/android/src/org/navitproject/navit/NavitMapDownloader.java

index d34d26e..af54be6 100644 (file)
@@ -66,12 +66,19 @@ public class Navit extends Activity implements Handler.Callback
        public static String                                            my_display_density                                      = "mdpi";\r
        private boolean                                                 parseErrorShown                                         = false;\r
        private static NavitMapDownloader       map_download                                                    = null;\r
-       public static final int                                 MAPDOWNLOAD_DIALOG                                      = 1;\r
-       public ProgressDialog                                   mapdownloader_dialog                                    = null;\r
-       public static NavitMapDownloader                mapdownloader                                                   = null;\r
-       public static final int                                 NavitDownloaderSelectMap_id             = 967;\r
+       public static final int                                 MAPDOWNLOAD_PRI_DIALOG                          = 1;\r
+       public static final int                                 MAPDOWNLOAD_SEC_DIALOG                          = 2;\r
+       public ProgressDialog                                   mapdownloader_dialog_pri                        = null;\r
+       public ProgressDialog                                   mapdownloader_dialog_sec                        = null;\r
+       public static NavitMapDownloader                mapdownloader_pri                                               = null;\r
+       public static NavitMapDownloader                mapdownloader_sec                                               = null;\r
+       public static final int                                 NavitDownloaderPriSelectMap_id  = 967;\r
+       public static final int                                 NavitDownloaderSecSelectMap_id  = 968;\r
        public static int                                                       download_map_id                                         = 0;\r
-       ProgressThread                                                          progressThread                                                  = null;\r
+       ProgressThread                                                          progressThread_pri                                      = null;\r
+       ProgressThread                                                          progressThread_sec                                      = null;\r
+       public static final int                                 MAP_NUM_PRIMARY                                         = 1;\r
+       public static final int                                 MAP_NUM_SECONDARY                                               = 1;\r
 \r
        private boolean extractRes(String resname, String result)\r
        {\r
@@ -467,7 +474,8 @@ public class Navit extends Activity implements Handler.Callback
                menu.add(1, 1, 10, "Zoom in");\r
                menu.add(1, 2, 20, "Zoom out");\r
 \r
-               menu.add(1, 3, 22, "download map");\r
+               menu.add(1, 3, 22, "download 1st map");\r
+               menu.add(1, 4, 23, "download 2nd map");\r
 \r
                menu.add(1, 99, 30, "Exit Navit");\r
                return true;\r
@@ -533,11 +541,18 @@ public class Navit extends Activity implements Handler.Callback
                                Log.e("Navit", "onOptionsItemSelected -> zoom out");\r
                                break;\r
                        case 3 :\r
-                               // map download menu\r
+                               // map download menu for primary\r
                                Intent map_download_list_activity = new Intent(this,\r
                                                NavitDownloadSelectMapActivity.class);\r
                                this.startActivityForResult(map_download_list_activity,\r
-                                               Navit.NavitDownloaderSelectMap_id);\r
+                                               Navit.NavitDownloaderPriSelectMap_id);\r
+                               break;\r
+                       case 4 :\r
+                               // map download menu for second map\r
+                               Intent map_download_list_activity2 = new Intent(this,\r
+                                               NavitDownloadSelectMapActivity.class);\r
+                               this.startActivityForResult(map_download_list_activity2,\r
+                                               Navit.NavitDownloaderSecSelectMap_id);\r
                                break;\r
                        case 99 :\r
                                // exit\r
@@ -558,7 +573,7 @@ public class Navit extends Activity implements Handler.Callback
        {\r
                switch (requestCode)\r
                {\r
-                       case Navit.NavitDownloaderSelectMap_id :\r
+                       case Navit.NavitDownloaderPriSelectMap_id :\r
                                try\r
                                {\r
                                        if (resultCode == Activity.RESULT_OK)\r
@@ -569,7 +584,35 @@ public class Navit extends Activity implements Handler.Callback
                                                        // set map id to download\r
                                                        Navit.download_map_id = Integer.parseInt(data.getStringExtra("selected_id"));\r
                                                        // show the map download progressbar, and download the map\r
-                                                       showDialog(Navit.MAPDOWNLOAD_DIALOG);\r
+                                                       showDialog(Navit.MAP_NUM_PRIMARY);\r
+                                               }\r
+                                               catch (NumberFormatException e)\r
+                                               {\r
+                                                       Log.d("Navit", "NumberFormatException selected_id");\r
+                                               }\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               // user pressed back key\r
+                                       }\r
+                               }\r
+                               catch (Exception e)\r
+                               {\r
+                                       Log.d("Navit", "error on onActivityResult");\r
+                               }\r
+                               break;\r
+                       case Navit.NavitDownloaderSecSelectMap_id :\r
+                               try\r
+                               {\r
+                                       if (resultCode == Activity.RESULT_OK)\r
+                                       {\r
+                                               try\r
+                                               {\r
+                                                       Log.d("Navit", "id=" + Integer.parseInt(data.getStringExtra("selected_id")));\r
+                                                       // set map id to download\r
+                                                       Navit.download_map_id = Integer.parseInt(data.getStringExtra("selected_id"));\r
+                                                       // show the map download progressbar, and download the map\r
+                                                       showDialog(Navit.MAP_NUM_SECONDARY);\r
                                                }\r
                                                catch (NumberFormatException e)\r
                                                {\r
@@ -627,14 +670,30 @@ public class Navit extends Activity implements Handler.Callback
                                                                                                                                break;\r
                                                                                                                        case 1 :\r
                                                                                                                                // change progressbar values\r
-                                                                                                                               mapdownloader_dialog.setMax(msg.getData().getInt(\r
-                                                                                                                                               "max"));\r
-                                                                                                                               mapdownloader_dialog.setProgress(msg.getData()\r
-                                                                                                                                               .getInt("cur"));\r
-                                                                                                                               mapdownloader_dialog.setTitle(msg.getData()\r
-                                                                                                                                               .getString("title"));\r
-                                                                                                                               mapdownloader_dialog.setMessage(msg.getData()\r
-                                                                                                                                               .getString("text"));\r
+                                                                                                                               int what_dialog = msg.getData()\r
+                                                                                                                                               .getInt("dialog_num");\r
+                                                                                                                               if (what_dialog == MAPDOWNLOAD_PRI_DIALOG)\r
+                                                                                                                               {\r
+                                                                                                                                       mapdownloader_dialog_pri.setMax(msg.getData()\r
+                                                                                                                                                       .getInt("max"));\r
+                                                                                                                                       mapdownloader_dialog_pri.setProgress(msg\r
+                                                                                                                                                       .getData().getInt("cur"));\r
+                                                                                                                                       mapdownloader_dialog_pri.setTitle(msg.getData()\r
+                                                                                                                                                       .getString("title"));\r
+                                                                                                                                       mapdownloader_dialog_pri.setMessage(msg\r
+                                                                                                                                                       .getData().getString("text"));\r
+                                                                                                                               }\r
+                                                                                                                               else if (what_dialog == MAPDOWNLOAD_SEC_DIALOG)\r
+                                                                                                                               {\r
+                                                                                                                                       mapdownloader_dialog_sec.setMax(msg.getData()\r
+                                                                                                                                                       .getInt("max"));\r
+                                                                                                                                       mapdownloader_dialog_sec.setProgress(msg\r
+                                                                                                                                                       .getData().getInt("cur"));\r
+                                                                                                                                       mapdownloader_dialog_sec.setTitle(msg.getData()\r
+                                                                                                                                                       .getString("title"));\r
+                                                                                                                                       mapdownloader_dialog_sec.setMessage(msg\r
+                                                                                                                                                       .getData().getString("text"));\r
+                                                                                                                               }\r
                                                                                                                                break;\r
                                                                                                                        case 2 :\r
                                                                                                                                Toast.makeText(getApplicationContext(),\r
@@ -649,37 +708,60 @@ public class Navit extends Activity implements Handler.Callback
        {\r
                switch (id)\r
                {\r
-                       case Navit.MAPDOWNLOAD_DIALOG :\r
-\r
-                               mapdownloader_dialog = new ProgressDialog(this);\r
-                               mapdownloader_dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r
-                               mapdownloader_dialog.setTitle("--");\r
-                               mapdownloader_dialog.setMessage("--");\r
-                               mapdownloader_dialog.setCancelable(true);\r
-                               mapdownloader_dialog.setProgress(0);\r
-                               mapdownloader_dialog.setMax(200);\r
+                       case Navit.MAPDOWNLOAD_PRI_DIALOG :\r
+                               mapdownloader_dialog_pri = new ProgressDialog(this);\r
+                               mapdownloader_dialog_pri.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r
+                               mapdownloader_dialog_pri.setTitle("--");\r
+                               mapdownloader_dialog_pri.setMessage("--");\r
+                               mapdownloader_dialog_pri.setCancelable(true);\r
+                               mapdownloader_dialog_pri.setProgress(0);\r
+                               mapdownloader_dialog_pri.setMax(200);\r
                                DialogInterface.OnDismissListener mOnDismissListener = new DialogInterface.OnDismissListener()\r
                                {\r
                                        public void onDismiss(DialogInterface dialog)\r
                                        {\r
-                                               Log.e("Navit", "onDismiss: mapdownloader_dialog");\r
+                                               Log.e("Navit", "onDismiss: mapdownloader_dialog pri");\r
+                                               dialog.dismiss();\r
+                                               dialog.cancel();\r
+                                               progressThread_pri.stop_thread();\r
+                                       }\r
+                               };\r
+                               mapdownloader_dialog_pri.setOnDismissListener(mOnDismissListener);\r
+                               mapdownloader_pri = new NavitMapDownloader(this);\r
+                               //map_download.download_osm_map(NavitMapDownloader.austria);\r
+                               progressThread_pri = mapdownloader_pri.new ProgressThread(progress_handler,\r
+                                               NavitMapDownloader.OSM_MAPS[Navit.download_map_id], MAP_NUM_PRIMARY);\r
+                               progressThread_pri.start();\r
+                               return mapdownloader_dialog_pri;\r
+                       case Navit.MAPDOWNLOAD_SEC_DIALOG :\r
+                               mapdownloader_dialog_sec = new ProgressDialog(this);\r
+                               mapdownloader_dialog_sec.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r
+                               mapdownloader_dialog_sec.setTitle("--");\r
+                               mapdownloader_dialog_sec.setMessage("--");\r
+                               mapdownloader_dialog_sec.setCancelable(true);\r
+                               mapdownloader_dialog_sec.setProgress(0);\r
+                               mapdownloader_dialog_sec.setMax(200);\r
+                               DialogInterface.OnDismissListener mOnDismissListener2 = new DialogInterface.OnDismissListener()\r
+                               {\r
+                                       public void onDismiss(DialogInterface dialog)\r
+                                       {\r
+                                               Log.e("Navit", "onDismiss: mapdownloader_dialog sec");\r
                                                dialog.dismiss();\r
                                                dialog.cancel();\r
-                                               progressThread.stop_thread();\r
+                                               progressThread_sec.stop_thread();\r
                                        }\r
                                };\r
-                               mapdownloader_dialog.setOnDismissListener(mOnDismissListener);\r
-                               mapdownloader = new NavitMapDownloader(this);\r
+                               mapdownloader_dialog_sec.setOnDismissListener(mOnDismissListener2);\r
+                               mapdownloader_sec = new NavitMapDownloader(this);\r
                                //map_download.download_osm_map(NavitMapDownloader.austria);\r
-                               progressThread = mapdownloader.new ProgressThread(progress_handler,\r
-                                               NavitMapDownloader.OSM_MAPS[Navit.download_map_id]);\r
-                               progressThread.start();\r
-                               return mapdownloader_dialog;\r
+                               progressThread_sec = mapdownloader_sec.new ProgressThread(progress_handler,\r
+                                               NavitMapDownloader.OSM_MAPS[Navit.download_map_id], MAP_NUM_SECONDARY);\r
+                               progressThread_sec.start();\r
+                               return mapdownloader_dialog_sec;\r
                }\r
                // should never get here!!\r
                return null;\r
        }\r
-\r
        public void disableSuspend()\r
        {\r
                wl.acquire();\r
index 39ecb5f..4609bff 100644 (file)
@@ -43,8 +43,10 @@ public class NavitMapDownloader
                String  lat1;\r
                String  lon2;\r
                String  lat2;\r
-               String  map_name                        = "";\r
-               long            est_size_bytes  = 0;\r
+               String  map_name                                                                = "";\r
+               long            est_size_bytes                                          = 0;\r
+               String  est_size_bytes_human_string     = "";\r
+               String  text_for_select_list                            = "";\r
 \r
                public osm_map_values(String mapname, String lon_1, String lat_1, String lon_2, String lat_2,\r
                                long bytes_est)\r
@@ -55,6 +57,9 @@ public class NavitMapDownloader
                        this.lon2 = lon_2;\r
                        this.lat2 = lat_2;\r
                        this.est_size_bytes = bytes_est;\r
+                       this.est_size_bytes_human_string = " ca. "\r
+                                       + (int) ((float) (this.est_size_bytes) / 1024f / 1024f) + "MB";\r
+                       this.text_for_select_list = this.map_name + " " + this.est_size_bytes_human_string;\r
                }\r
        }\r
 \r
@@ -81,351 +86,413 @@ public class NavitMapDownloader
         */\r
 \r
 \r
-       public static osm_map_values            Whole_Planet                                                    = new osm_map_values(\r
-                                                                                                                                                                                                       "Whole Planet", "-180",\r
-                                                                                                                                                                                                       "-90", "180", "90",\r
-                                                                                                                                                                                                       5985878379L);\r
-       public static osm_map_values            Africa                                                                  = new osm_map_values("Africa",\r
-                                                                                                                                                                                                       "-20.8", "-35.2",\r
-                                                                                                                                                                                                       "52.5", "37.4",\r
-                                                                                                                                                                                                       180836389L);\r
-       public static osm_map_values            Angola                                                                  = new osm_map_values("Angola",\r
-                                                                                                                                                                                                       "11.4", "-18.1", "24.2",\r
-                                                                                                                                                                                                       "-5.3", 56041641L);\r
-       public static osm_map_values            Burundi                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Burundi", "28.9",\r
-                                                                                                                                                                                                       "-4.5", "30.9", "-2.2",\r
-                                                                                                                                                                                                       56512924L);\r
-       public static osm_map_values            Democratic_Republic_of_the_Congo        = new osm_map_values(\r
-                                                                                                                                                                                                       "Democratic Republic of the Congo",\r
-                                                                                                                                                                                                       "11.7", "-13.6", "31.5",\r
-                                                                                                                                                                                                       "5.7", 65026791L);\r
-       public static osm_map_values            Kenya                                                                           = new osm_map_values("Kenya",\r
-                                                                                                                                                                                                       "33.8", "-5.2", "42.4",\r
-                                                                                                                                                                                                       "4.9", 58545273L);\r
-       public static osm_map_values            Lesotho                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Lesotho", "26.9",\r
-                                                                                                                                                                                                       "-30.7", "29.6",\r
-                                                                                                                                                                                                       "-28.4", 54791041L);\r
-       public static osm_map_values            Madagascar                                                              = new osm_map_values(\r
-                                                                                                                                                                                                       "Madagascar", "43.0",\r
-                                                                                                                                                                                                       "-25.8", "50.8",\r
-                                                                                                                                                                                                       "-11.8", 56801099L);\r
-       public static osm_map_values            Nambia_Botswana                                         = new osm_map_values(\r
-                                                                                                                                                                                                       "Nambia+Botswana",\r
-                                                                                                                                                                                                       "11.4", "-29.1", "29.5",\r
-                                                                                                                                                                                                       "-16.9", 61807049L);\r
-       public static osm_map_values            Reunion                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Reunion", "55.2",\r
-                                                                                                                                                                                                       "-21.4", "55.9",\r
-                                                                                                                                                                                                       "-20.9", 58537419L);\r
-       public static osm_map_values            Rwanda                                                                  = new osm_map_values("Rwanda",\r
-                                                                                                                                                                                                       "28.8", "-2.9", "30.9",\r
-                                                                                                                                                                                                       "-1.0", 56313710L);\r
-       public static osm_map_values            South_Africa                                                    = new osm_map_values(\r
-                                                                                                                                                                                                       "South Africa", "15.6",\r
-                                                                                                                                                                                                       "-35.2", "33.3",\r
-                                                                                                                                                                                                       "-21.9", 73545245L);\r
-       public static osm_map_values            Uganda                                                                  = new osm_map_values("Uganda",\r
-                                                                                                                                                                                                       "29.3", "-1.6", "35.1",\r
-                                                                                                                                                                                                       "4.3", 57376589L);\r
-       public static osm_map_values            Asia                                                                            = new osm_map_values("Asia",\r
-                                                                                                                                                                                                       "23.8", "0.1", "195.0",\r
-                                                                                                                                                                                                       "82.4", 797725952L);\r
-       public static osm_map_values            China                                                                           = new osm_map_values("China",\r
-                                                                                                                                                                                                       "67.3", "5.3", "135.0",\r
-                                                                                                                                                                                                       "54.5", 259945160L);\r
-       public static osm_map_values            Cyprus                                                                  = new osm_map_values("Cyprus",\r
-                                                                                                                                                                                                       "32.0", "34.5", "34.9",\r
-                                                                                                                                                                                                       "35.8", 58585278L);\r
-       public static osm_map_values            India_Nepal                                                             = new osm_map_values(\r
-                                                                                                                                                                                                       "India+Nepal", "67.9",\r
-                                                                                                                                                                                                       "5.5", "89.6", "36.0",\r
-                                                                                                                                                                                                       82819344L);\r
-       public static osm_map_values            Indonesia                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Indonesia", "93.7",\r
-                                                                                                                                                                                                       "-17.3", "155.5", "7.6",\r
-                                                                                                                                                                                                       74648081L);\r
-       public static osm_map_values            Iran                                                                            = new osm_map_values("Iran",\r
-                                                                                                                                                                                                       "43.5", "24.4", "63.6",\r
-                                                                                                                                                                                                       "40.4", 69561312L);\r
-       public static osm_map_values            Iraq                                                                            = new osm_map_values("Iraq",\r
-                                                                                                                                                                                                       "38.7", "28.5", "49.2",\r
-                                                                                                                                                                                                       "37.4", 59146383L);\r
-       public static osm_map_values            Israel                                                                  = new osm_map_values("Israel",\r
-                                                                                                                                                                                                       "33.99", "29.8",\r
-                                                                                                                                                                                                       "35.95", "33.4",\r
-                                                                                                                                                                                                       65065351L);\r
-       public static osm_map_values            Japan_Korea_Taiwan                                      = new osm_map_values(\r
-                                                                                                                                                                                                       "Japan+Korea+Taiwan",\r
-                                                                                                                                                                                                       "117.6", "20.5",\r
-                                                                                                                                                                                                       "151.3", "47.1",\r
-                                                                                                                                                                                                       305538751L);\r
-       public static osm_map_values            Malasia_Singapore                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Malasia+Singapore",\r
-                                                                                                                                                                                                       "94.3", "-5.9", "108.6",\r
-                                                                                                                                                                                                       "6.8", 58849792L);\r
-       public static osm_map_values            Mongolia                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Mongolia", "87.5",\r
-                                                                                                                                                                                                       "41.4", "120.3", "52.7",\r
-                                                                                                                                                                                                       60871187L);\r
-       public static osm_map_values            Thailand                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Thailand", "97.5",\r
-                                                                                                                                                                                                       "5.7", "105.2", "19.7",\r
-                                                                                                                                                                                                       62422864L);\r
-       public static osm_map_values            Turkey                                                                  = new osm_map_values("Turkey",\r
-                                                                                                                                                                                                       "25.1", "35.8", "46.4",\r
-                                                                                                                                                                                                       "42.8", 81758047L);\r
-       public static osm_map_values            UAE_Other                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "UAE+Other", "51.5",\r
-                                                                                                                                                                                                       "22.6", "56.7", "26.5",\r
-                                                                                                                                                                                                       57419510L);\r
-       public static osm_map_values            Australia                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Australia", "110.5",\r
-                                                                                                                                                                                                       "-44.2", "154.9",\r
-                                                                                                                                                                                                       "-9.2", 128502185L);\r
-       public static osm_map_values            Tasmania                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Tasmania", "144.0",\r
-                                                                                                                                                                                                       "-45.1", "155.3",\r
-                                                                                                                                                                                                       "-24.8", 103573989L);\r
-       public static osm_map_values            Victoria_New_South_Wales                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Victoria+New South Wales",\r
-                                                                                                                                                                                                       "140.7", "-39.4",\r
-                                                                                                                                                                                                       "153.7", "-26.9",\r
-                                                                                                                                                                                                       99307594L);\r
-       public static osm_map_values            New_Zealand                                                             = new osm_map_values(\r
-                                                                                                                                                                                                       "New Zealand", "165.2",\r
-                                                                                                                                                                                                       "-47.6", "179.1",\r
-                                                                                                                                                                                                       "-33.7", 64757454L);\r
-       public static osm_map_values            Europe                                                                  = new osm_map_values("Europe",\r
-                                                                                                                                                                                                       "-12.97", "33.59",\r
-                                                                                                                                                                                                       "34.15", "72.10",\r
-                                                                                                                                                                                                       2753910015L);\r
-       public static osm_map_values            Western_Europe                                                  = new osm_map_values(\r
-                                                                                                                                                                                                       "Western Europe",\r
-                                                                                                                                                                                                       "-17.6", "34.5", "42.9",\r
-                                                                                                                                                                                                       "70.9", 2832986851L);\r
-       public static osm_map_values            Austria                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Austria", "9.4",\r
-                                                                                                                                                                                                       "46.32", "17.21",\r
-                                                                                                                                                                                                       "49.1", 222359992L);\r
-       public static osm_map_values            BeNeLux                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "BeNeLux", "2.08",\r
-                                                                                                                                                                                                       "48.87", "7.78",\r
-                                                                                                                                                                                                       "54.52", 533865194L);\r
-       public static osm_map_values            Faroe_Islands                                                   = new osm_map_values(\r
-                                                                                                                                                                                                       "Faroe Islands", "-7.8",\r
-                                                                                                                                                                                                       "61.3", "-6.1", "62.5",\r
-                                                                                                                                                                                                       54526101L);\r
-       public static osm_map_values            France                                                                  = new osm_map_values("France",\r
-                                                                                                                                                                                                       "-5.45", "42.00",\r
-                                                                                                                                                                                                       "8.44", "51.68",\r
-                                                                                                                                                                                                       1112047845L);\r
-       public static osm_map_values            Germany                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Germany", "5.18",\r
-                                                                                                                                                                                                       "46.84", "15.47",\r
-                                                                                                                                                                                                       "55.64", 944716238L);\r
-       public static osm_map_values            Bavaria                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Bavaria", "10.3",\r
-                                                                                                                                                                                                       "47.8", "13.6", "49.7",\r
-                                                                                                                                                                                                       131799419L);\r
-       public static osm_map_values            Saxonia                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Saxonia", "11.8",\r
-                                                                                                                                                                                                       "50.1", "15.0", "51.7",\r
-                                                                                                                                                                                                       112073909L);\r
-       public static osm_map_values            Germany_Austria_Switzerland             = new osm_map_values(\r
-                                                                                                                                                                                                       "Germany+Austria+Switzerland",\r
-                                                                                                                                                                                                       "3.4", "44.5", "18.6",\r
-                                                                                                                                                                                                       "55.1", 1385785353L);\r
-       public static osm_map_values            Iceland                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Iceland", "-25.3",\r
-                                                                                                                                                                                                       "62.8", "-11.4", "67.5",\r
-                                                                                                                                                                                                       57281405L);\r
-       public static osm_map_values            Ireland                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Ireland", "-11.17",\r
-                                                                                                                                                                                                       "51.25", "-5.23",\r
-                                                                                                                                                                                                       "55.9", 70186936L);\r
-       public static osm_map_values            Italy                                                                           = new osm_map_values("Italy",\r
-                                                                                                                                                                                                       "6.52", "36.38",\r
-                                                                                                                                                                                                       "18.96", "47.19",\r
-                                                                                                                                                                                                       291401314L);\r
-       public static osm_map_values            Spain_Portugal                                                  = new osm_map_values(\r
-                                                                                                                                                                                                       "Spain+Portugal",\r
-                                                                                                                                                                                                       "-11.04", "34.87",\r
-                                                                                                                                                                                                       "4.62", "44.41",\r
-                                                                                                                                                                                                       292407746L);\r
-       public static osm_map_values            Mallorca                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Mallorca", "2.2",\r
-                                                                                                                                                                                                       "38.8", "4.7", "40.2",\r
-                                                                                                                                                                                                       59700600L);\r
-       public static osm_map_values            Galicia                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Galicia", "-10.0",\r
-                                                                                                                                                                                                       "41.7", "-6.3", "44.1",\r
-                                                                                                                                                                                                       64605237L);\r
-       public static osm_map_values            Scandinavia                                                             = new osm_map_values(\r
-                                                                                                                                                                                                       "Scandinavia", "4.0",\r
-                                                                                                                                                                                                       "54.4", "32.1", "71.5",\r
-                                                                                                                                                                                                       299021928L);\r
-       public static osm_map_values            Finland                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Finland", "18.6",\r
-                                                                                                                                                                                                       "59.2", "32.3", "70.3",\r
-                                                                                                                                                                                                       128871467L);\r
-       public static osm_map_values            Denmark                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Denmark", "7.49",\r
-                                                                                                                                                                                                       "54.33", "13.05",\r
-                                                                                                                                                                                                       "57.88", 120025875L);\r
-       public static osm_map_values            Switzerland                                                             = new osm_map_values(\r
-                                                                                                                                                                                                       "Switzerland", "5.79",\r
-                                                                                                                                                                                                       "45.74", "10.59",\r
-                                                                                                                                                                                                       "47.84", 162616817L);\r
-       public static osm_map_values            UK                                                                                      = new osm_map_values("UK",\r
-                                                                                                                                                                                                       "-9.7", "49.6", "2.2",\r
-                                                                                                                                                                                                       "61.2", 245161510L);\r
-       public static osm_map_values            Bulgaria                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Bulgaria", "24.7",\r
-                                                                                                                                                                                                       "42.1", "24.8", "42.1",\r
-                                                                                                                                                                                                       56607427L);\r
-       public static osm_map_values            Czech_Republic                                                  = new osm_map_values(\r
-                                                                                                                                                                                                       "Czech Republic",\r
-                                                                                                                                                                                                       "11.91", "48.48",\r
-                                                                                                                                                                                                       "19.02", "51.17",\r
-                                                                                                                                                                                                       234138824L);\r
-       public static osm_map_values            Croatia                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Croatia", "13.4",\r
-                                                                                                                                                                                                       "42.1", "19.4", "46.9",\r
-                                                                                                                                                                                                       99183280L);\r
-       public static osm_map_values            Estonia                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Estonia", "21.5",\r
-                                                                                                                                                                                                       "57.5", "28.2", "59.6",\r
-                                                                                                                                                                                                       79276178L);\r
-       public static osm_map_values            Greece                                                                  = new osm_map_values("Greece",\r
-                                                                                                                                                                                                       "28.9", "37.8", "29.0",\r
-                                                                                                                                                                                                       "37.8", 55486527L);\r
-       public static osm_map_values            Crete                                                                           = new osm_map_values("Crete",\r
-                                                                                                                                                                                                       "23.3", "34.5", "26.8",\r
-                                                                                                                                                                                                       "36.0", 57032630L);\r
-       public static osm_map_values            Hungary                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Hungary", "16.08",\r
-                                                                                                                                                                                                       "45.57", "23.03",\r
-                                                                                                                                                                                                       "48.39", 109831319L);\r
-       public static osm_map_values            Latvia                                                                  = new osm_map_values("Latvia",\r
-                                                                                                                                                                                                       "20.7", "55.6", "28.3",\r
-                                                                                                                                                                                                       "58.1", 71490706L);\r
-       public static osm_map_values            Lithuania                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Lithuania", "20.9",\r
-                                                                                                                                                                                                       "53.8", "26.9", "56.5",\r
-                                                                                                                                                                                                       67992457L);\r
-       public static osm_map_values            Poland                                                                  = new osm_map_values("Poland",\r
-                                                                                                                                                                                                       "13.6", "48.8", "24.5",\r
-                                                                                                                                                                                                       "55.0", 266136768L);\r
-       public static osm_map_values            Romania                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Romania", "20.3",\r
-                                                                                                                                                                                                       "43.5", "29.9", "48.4",\r
-                                                                                                                                                                                                       134525863L);\r
-       public static osm_map_values            North_America                                                   = new osm_map_values(\r
-                                                                                                                                                                                                       "North America",\r
-                                                                                                                                                                                                       "-178.1", "6.5",\r
-                                                                                                                                                                                                       "-10.4", "84.0",\r
-                                                                                                                                                                                                       2477309662L);\r
-       public static osm_map_values            Alaska                                                                  = new osm_map_values("Alaska",\r
-                                                                                                                                                                                                       "-179.5", "49.5",\r
-                                                                                                                                                                                                       "-129", "71.6",\r
-                                                                                                                                                                                                       72320027L);\r
-       public static osm_map_values            Canada                                                                  = new osm_map_values("Canada",\r
-                                                                                                                                                                                                       "-141.3", "41.5",\r
-                                                                                                                                                                                                       "-52.2", "70.2",\r
-                                                                                                                                                                                                       937813467L);\r
-       public static osm_map_values            Hawaii                                                                  = new osm_map_values("Hawaii",\r
-                                                                                                                                                                                                       "-161.07", "18.49",\r
-                                                                                                                                                                                                       "-154.45", "22.85",\r
-                                                                                                                                                                                                       57311788L);\r
-       public static osm_map_values            USA__except_Alaska_and_Hawaii_  = new osm_map_values(\r
-                                                                                                                                                                                                       "USA (except Alaska and Hawaii)",\r
-                                                                                                                                                                                                       "-125.4", "24.3",\r
-                                                                                                                                                                                                       "-66.5", "49.3",\r
-                                                                                                                                                                                                       2216912004L);\r
-       public static osm_map_values            Nevada                                                                  = new osm_map_values("Nevada",\r
-                                                                                                                                                                                                       "-120.2", "35.0",\r
-                                                                                                                                                                                                       "-113.8", "42.1",\r
-                                                                                                                                                                                                       136754975L);\r
-       public static osm_map_values            Oregon                                                                  = new osm_map_values("Oregon",\r
-                                                                                                                                                                                                       "-124.8", "41.8",\r
-                                                                                                                                                                                                       "-116.3", "46.3",\r
-                                                                                                                                                                                                       101627308L);\r
-       public static osm_map_values            Washington_State                                                = new osm_map_values(\r
-                                                                                                                                                                                                       "Washington State",\r
-                                                                                                                                                                                                       "-125.0", "45.5",\r
-                                                                                                                                                                                                       "-116.9", "49.0",\r
-                                                                                                                                                                                                       98178877L);\r
-       public static osm_map_values            South_Middle_America                                    = new osm_map_values(\r
-                                                                                                                                                                                                       "South+Middle America",\r
-                                                                                                                                                                                                       "-83.5", "-56.3",\r
-                                                                                                                                                                                                       "-30.8", "13.7",\r
-                                                                                                                                                                                                       159615197L);\r
-       public static osm_map_values            Argentina                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Argentina", "-73.9",\r
-                                                                                                                                                                                                       "-57.3", "-51.6",\r
-                                                                                                                                                                                                       "-21.0", 87516152L);\r
-       public static osm_map_values            Argentina_Chile                                         = new osm_map_values(\r
-                                                                                                                                                                                                       "Argentina+Chile",\r
-                                                                                                                                                                                                       "-77.2", "-56.3",\r
-                                                                                                                                                                                                       "-52.7", "-16.1",\r
-                                                                                                                                                                                                       91976696L);\r
-       public static osm_map_values            Bolivia                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Bolivia", "-70.5",\r
-                                                                                                                                                                                                       "-23.1", "-57.3",\r
-                                                                                                                                                                                                       "-9.3", 58242168L);\r
-       public static osm_map_values            Brazil                                                                  = new osm_map_values("Brazil",\r
-                                                                                                                                                                                                       "-71.4", "-34.7",\r
-                                                                                                                                                                                                       "-32.8", "5.4",\r
-                                                                                                                                                                                                       105527899L);\r
-       public static osm_map_values            Cuba                                                                            = new osm_map_values("Cuba",\r
-                                                                                                                                                                                                       "-85.3", "19.6",\r
-                                                                                                                                                                                                       "-74.0", "23.6",\r
-                                                                                                                                                                                                       56608942L);\r
-       public static osm_map_values            Colombia                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Colombia", "-79.1",\r
-                                                                                                                                                                                                       "-4.0", "-66.7", "12.6",\r
-                                                                                                                                                                                                       78658454L);\r
-       public static osm_map_values            Ecuador                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Ecuador", "-82.6",\r
-                                                                                                                                                                                                       "-5.4", "-74.4", "2.3",\r
-                                                                                                                                                                                                       61501914L);\r
-       public static osm_map_values            Guyana_Suriname_Guyane_Francaise        = new osm_map_values(\r
-                                                                                                                                                                                                       "Guyana+Suriname+Guyane Francaise",\r
-                                                                                                                                                                                                       "-62.0", "1.0", "-51.2",\r
-                                                                                                                                                                                                       "8.9", 57040689L);\r
-       public static osm_map_values            Haiti_Republica_Dominicana                      = new osm_map_values(\r
-                                                                                                                                                                                                       "Haiti+Republica Dominicana",\r
-                                                                                                                                                                                                       "-74.8", "17.3",\r
-                                                                                                                                                                                                       "-68.2", "20.1",\r
-                                                                                                                                                                                                       63528584L);\r
-       public static osm_map_values            Jamaica                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Jamaica", "-78.6",\r
-                                                                                                                                                                                                       "17.4", "-75.9", "18.9",\r
-                                                                                                                                                                                                       53958307L);\r
-       public static osm_map_values            Mexico                                                                  = new osm_map_values("Mexico",\r
-                                                                                                                                                                                                       "-117.6", "14.1",\r
-                                                                                                                                                                                                       "-86.4", "32.8",\r
-                                                                                                                                                                                                       251108617L);\r
-       public static osm_map_values            Paraguay                                                                        = new osm_map_values(\r
-                                                                                                                                                                                                       "Paraguay", "-63.8",\r
-                                                                                                                                                                                                       "-28.1", "-53.6",\r
-                                                                                                                                                                                                       "-18.8", 57188715L);\r
-       public static osm_map_values            Peru                                                                            = new osm_map_values("Peru",\r
-                                                                                                                                                                                                       "-82.4", "-18.1",\r
-                                                                                                                                                                                                       "-67.5", "0.4",\r
-                                                                                                                                                                                                       65421441L);\r
-       public static osm_map_values            Uruguay                                                                 = new osm_map_values(\r
-                                                                                                                                                                                                       "Uruguay", "-59.2",\r
-                                                                                                                                                                                                       "-36.5", "-51.7",\r
-                                                                                                                                                                                                       "-29.7", 63542225L);\r
-       public static osm_map_values            Venezuela                                                               = new osm_map_values(\r
-                                                                                                                                                                                                       "Venezuela", "-73.6",\r
-                                                                                                                                                                                                       "0.4", "-59.7", "12.8",\r
-                                                                                                                                                                                                       64838882L);\r
-\r
-       public static osm_map_values[]  OSM_MAPS                                                                        = new osm_map_values[]{\r
+       public static osm_map_values            Whole_Planet                                                                    = new osm_map_values(\r
+                                                                                                                                                                                                                       "Whole Planet",\r
+                                                                                                                                                                                                                       "-180", "-90",\r
+                                                                                                                                                                                                                       "180", "90",\r
+                                                                                                                                                                                                                       5985878379L);\r
+       public static osm_map_values            Africa                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Africa", "-20.8",\r
+                                                                                                                                                                                                                       "-35.2", "52.5",\r
+                                                                                                                                                                                                                       "37.4", 180836389L);\r
+       public static osm_map_values            Angola                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Angola", "11.4",\r
+                                                                                                                                                                                                                       "-18.1", "24.2",\r
+                                                                                                                                                                                                                       "-5.3", 56041641L);\r
+       public static osm_map_values            Burundi                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Burundi", "28.9",\r
+                                                                                                                                                                                                                       "-4.5", "30.9",\r
+                                                                                                                                                                                                                       "-2.2", 56512924L);\r
+       public static osm_map_values            Democratic_Republic_of_the_Congo                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Democratic Republic of the Congo",\r
+                                                                                                                                                                                                                       "11.7", "-13.6",\r
+                                                                                                                                                                                                                       "31.5", "5.7",\r
+                                                                                                                                                                                                                       65026791L);\r
+       public static osm_map_values            Kenya                                                                                           = new osm_map_values(\r
+                                                                                                                                                                                                                       "Kenya", "33.8",\r
+                                                                                                                                                                                                                       "-5.2", "42.4",\r
+                                                                                                                                                                                                                       "4.9", 58545273L);\r
+       public static osm_map_values            Lesotho                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Lesotho", "26.9",\r
+                                                                                                                                                                                                                       "-30.7", "29.6",\r
+                                                                                                                                                                                                                       "-28.4", 54791041L);\r
+       public static osm_map_values            Madagascar                                                                              = new osm_map_values(\r
+                                                                                                                                                                                                                       "Madagascar",\r
+                                                                                                                                                                                                                       "43.0", "-25.8",\r
+                                                                                                                                                                                                                       "50.8", "-11.8",\r
+                                                                                                                                                                                                                       56801099L);\r
+       public static osm_map_values            Nambia_Botswana                                                         = new osm_map_values(\r
+                                                                                                                                                                                                                       "Nambia+Botswana",\r
+                                                                                                                                                                                                                       "11.4", "-29.1",\r
+                                                                                                                                                                                                                       "29.5", "-16.9",\r
+                                                                                                                                                                                                                       61807049L);\r
+       public static osm_map_values            Reunion                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Reunion", "55.2",\r
+                                                                                                                                                                                                                       "-21.4", "55.9",\r
+                                                                                                                                                                                                                       "-20.9", 58537419L);\r
+       public static osm_map_values            Rwanda                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Rwanda", "28.8",\r
+                                                                                                                                                                                                                       "-2.9", "30.9",\r
+                                                                                                                                                                                                                       "-1.0", 56313710L);\r
+       public static osm_map_values            South_Africa                                                                    = new osm_map_values(\r
+                                                                                                                                                                                                                       "South Africa",\r
+                                                                                                                                                                                                                       "15.6", "-35.2",\r
+                                                                                                                                                                                                                       "33.3", "-21.9",\r
+                                                                                                                                                                                                                       73545245L);\r
+       public static osm_map_values            Uganda                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Uganda", "29.3",\r
+                                                                                                                                                                                                                       "-1.6", "35.1",\r
+                                                                                                                                                                                                                       "4.3", 57376589L);\r
+       public static osm_map_values            Asia                                                                                            = new osm_map_values(\r
+                                                                                                                                                                                                                       "Asia", "23.8",\r
+                                                                                                                                                                                                                       "0.1", "195.0",\r
+                                                                                                                                                                                                                       "82.4", 797725952L);\r
+       public static osm_map_values            China                                                                                           = new osm_map_values(\r
+                                                                                                                                                                                                                       "China", "67.3",\r
+                                                                                                                                                                                                                       "5.3", "135.0",\r
+                                                                                                                                                                                                                       "54.5", 259945160L);\r
+       public static osm_map_values            Cyprus                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Cyprus", "32.0",\r
+                                                                                                                                                                                                                       "34.5", "34.9",\r
+                                                                                                                                                                                                                       "35.8", 58585278L);\r
+       public static osm_map_values            India_Nepal                                                                             = new osm_map_values(\r
+                                                                                                                                                                                                                       "India+Nepal",\r
+                                                                                                                                                                                                                       "67.9", "5.5",\r
+                                                                                                                                                                                                                       "89.6", "36.0",\r
+                                                                                                                                                                                                                       82819344L);\r
+       public static osm_map_values            Indonesia                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Indonesia",\r
+                                                                                                                                                                                                                       "93.7", "-17.3",\r
+                                                                                                                                                                                                                       "155.5", "7.6",\r
+                                                                                                                                                                                                                       74648081L);\r
+       public static osm_map_values            Iran                                                                                            = new osm_map_values(\r
+                                                                                                                                                                                                                       "Iran", "43.5",\r
+                                                                                                                                                                                                                       "24.4", "63.6",\r
+                                                                                                                                                                                                                       "40.4", 69561312L);\r
+       public static osm_map_values            Iraq                                                                                            = new osm_map_values(\r
+                                                                                                                                                                                                                       "Iraq", "38.7",\r
+                                                                                                                                                                                                                       "28.5", "49.2",\r
+                                                                                                                                                                                                                       "37.4", 59146383L);\r
+       public static osm_map_values            Israel                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Israel", "33.99",\r
+                                                                                                                                                                                                                       "29.8", "35.95",\r
+                                                                                                                                                                                                                       "33.4", 65065351L);\r
+       public static osm_map_values            Japan_Korea_Taiwan                                                      = new osm_map_values(\r
+                                                                                                                                                                                                                       "Japan+Korea+Taiwan",\r
+                                                                                                                                                                                                                       "117.6", "20.5",\r
+                                                                                                                                                                                                                       "151.3", "47.1",\r
+                                                                                                                                                                                                                       305538751L);\r
+       public static osm_map_values            Malasia_Singapore                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Malasia+Singapore",\r
+                                                                                                                                                                                                                       "94.3", "-5.9",\r
+                                                                                                                                                                                                                       "108.6", "6.8",\r
+                                                                                                                                                                                                                       58849792L);\r
+       public static osm_map_values            Mongolia                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Mongolia",\r
+                                                                                                                                                                                                                       "87.5", "41.4",\r
+                                                                                                                                                                                                                       "120.3", "52.7",\r
+                                                                                                                                                                                                                       60871187L);\r
+       public static osm_map_values            Thailand                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Thailand",\r
+                                                                                                                                                                                                                       "97.5", "5.7",\r
+                                                                                                                                                                                                                       "105.2", "19.7",\r
+                                                                                                                                                                                                                       62422864L);\r
+       public static osm_map_values            Turkey                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Turkey", "25.1",\r
+                                                                                                                                                                                                                       "35.8", "46.4",\r
+                                                                                                                                                                                                                       "42.8", 81758047L);\r
+       public static osm_map_values            UAE_Other                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "UAE+Other",\r
+                                                                                                                                                                                                                       "51.5", "22.6",\r
+                                                                                                                                                                                                                       "56.7", "26.5",\r
+                                                                                                                                                                                                                       57419510L);\r
+       public static osm_map_values            Australia                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Australia",\r
+                                                                                                                                                                                                                       "110.5", "-44.2",\r
+                                                                                                                                                                                                                       "154.9", "-9.2",\r
+                                                                                                                                                                                                                       128502185L);\r
+       public static osm_map_values            Tasmania                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Tasmania",\r
+                                                                                                                                                                                                                       "144.0", "-45.1",\r
+                                                                                                                                                                                                                       "155.3", "-24.8",\r
+                                                                                                                                                                                                                       103573989L);\r
+       public static osm_map_values            Victoria_New_South_Wales                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Victoria+New South Wales",\r
+                                                                                                                                                                                                                       "140.7", "-39.4",\r
+                                                                                                                                                                                                                       "153.7", "-26.9",\r
+                                                                                                                                                                                                                       99307594L);\r
+       public static osm_map_values            New_Zealand                                                                             = new osm_map_values(\r
+                                                                                                                                                                                                                       "New Zealand",\r
+                                                                                                                                                                                                                       "165.2", "-47.6",\r
+                                                                                                                                                                                                                       "179.1", "-33.7",\r
+                                                                                                                                                                                                                       64757454L);\r
+       public static osm_map_values            Europe                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Europe",\r
+                                                                                                                                                                                                                       "-12.97", "33.59",\r
+                                                                                                                                                                                                                       "34.15", "72.10",\r
+                                                                                                                                                                                                                       2753910015L);\r
+       public static osm_map_values            Western_Europe                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Western Europe",\r
+                                                                                                                                                                                                                       "-17.6", "34.5",\r
+                                                                                                                                                                                                                       "42.9", "70.9",\r
+                                                                                                                                                                                                                       2832986851L);\r
+       public static osm_map_values            Austria                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Austria", "9.4",\r
+                                                                                                                                                                                                                       "46.32", "17.21",\r
+                                                                                                                                                                                                                       "49.1", 222359992L);\r
+       public static osm_map_values            BeNeLux                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "BeNeLux", "2.08",\r
+                                                                                                                                                                                                                       "48.87", "7.78",\r
+                                                                                                                                                                                                                       "54.52",\r
+                                                                                                                                                                                                                       533865194L);\r
+       public static osm_map_values            Faroe_Islands                                                                   = new osm_map_values(\r
+                                                                                                                                                                                                                       "Faroe Islands",\r
+                                                                                                                                                                                                                       "-7.8", "61.3",\r
+                                                                                                                                                                                                                       "-6.1", "62.5",\r
+                                                                                                                                                                                                                       54526101L);\r
+       public static osm_map_values            France                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "France", "-5.45",\r
+                                                                                                                                                                                                                       "42.00", "8.44",\r
+                                                                                                                                                                                                                       "51.68",\r
+                                                                                                                                                                                                                       1112047845L);\r
+       public static osm_map_values            Germany                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Germany", "5.18",\r
+                                                                                                                                                                                                                       "46.84", "15.47",\r
+                                                                                                                                                                                                                       "55.64",\r
+                                                                                                                                                                                                                       944716238L);\r
+       public static osm_map_values            Bavaria                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Bavaria", "10.3",\r
+                                                                                                                                                                                                                       "47.8", "13.6",\r
+                                                                                                                                                                                                                       "49.7", 131799419L);\r
+       public static osm_map_values            Saxonia                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Saxonia", "11.8",\r
+                                                                                                                                                                                                                       "50.1", "15.0",\r
+                                                                                                                                                                                                                       "51.7", 112073909L);\r
+       public static osm_map_values            Germany_Austria_Switzerland                             = new osm_map_values(\r
+                                                                                                                                                                                                                       "Germany+Austria+Switzerland",\r
+                                                                                                                                                                                                                       "3.4", "44.5",\r
+                                                                                                                                                                                                                       "18.6", "55.1",\r
+                                                                                                                                                                                                                       1385785353L);\r
+       public static osm_map_values            Iceland                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Iceland",\r
+                                                                                                                                                                                                                       "-25.3", "62.8",\r
+                                                                                                                                                                                                                       "-11.4", "67.5",\r
+                                                                                                                                                                                                                       57281405L);\r
+       public static osm_map_values            Ireland                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Ireland",\r
+                                                                                                                                                                                                                       "-11.17", "51.25",\r
+                                                                                                                                                                                                                       "-5.23", "55.9",\r
+                                                                                                                                                                                                                       70186936L);\r
+       public static osm_map_values            Italy                                                                                           = new osm_map_values(\r
+                                                                                                                                                                                                                       "Italy", "6.52",\r
+                                                                                                                                                                                                                       "36.38", "18.96",\r
+                                                                                                                                                                                                                       "47.19",\r
+                                                                                                                                                                                                                       291401314L);\r
+       public static osm_map_values            Spain_Portugal                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Spain+Portugal",\r
+                                                                                                                                                                                                                       "-11.04", "34.87",\r
+                                                                                                                                                                                                                       "4.62", "44.41",\r
+                                                                                                                                                                                                                       292407746L);\r
+       public static osm_map_values            Mallorca                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Mallorca", "2.2",\r
+                                                                                                                                                                                                                       "38.8", "4.7",\r
+                                                                                                                                                                                                                       "40.2", 59700600L);\r
+       public static osm_map_values            Galicia                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Galicia",\r
+                                                                                                                                                                                                                       "-10.0", "41.7",\r
+                                                                                                                                                                                                                       "-6.3", "44.1",\r
+                                                                                                                                                                                                                       64605237L);\r
+       public static osm_map_values            Scandinavia                                                                             = new osm_map_values(\r
+                                                                                                                                                                                                                       "Scandinavia",\r
+                                                                                                                                                                                                                       "4.0", "54.4",\r
+                                                                                                                                                                                                                       "32.1", "71.5",\r
+                                                                                                                                                                                                                       299021928L);\r
+       public static osm_map_values            Finland                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Finland", "18.6",\r
+                                                                                                                                                                                                                       "59.2", "32.3",\r
+                                                                                                                                                                                                                       "70.3", 128871467L);\r
+       public static osm_map_values            Denmark                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Denmark", "7.49",\r
+                                                                                                                                                                                                                       "54.33", "13.05",\r
+                                                                                                                                                                                                                       "57.88",\r
+                                                                                                                                                                                                                       120025875L);\r
+       public static osm_map_values            Switzerland                                                                             = new osm_map_values(\r
+                                                                                                                                                                                                                       "Switzerland",\r
+                                                                                                                                                                                                                       "5.79", "45.74",\r
+                                                                                                                                                                                                                       "10.59", "47.84",\r
+                                                                                                                                                                                                                       162616817L);\r
+       public static osm_map_values            UK                                                                                                      = new osm_map_values(\r
+                                                                                                                                                                                                                       "UK", "-9.7",\r
+                                                                                                                                                                                                                       "49.6", "2.2",\r
+                                                                                                                                                                                                                       "61.2", 245161510L);\r
+       public static osm_map_values            Bulgaria                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Bulgaria",\r
+                                                                                                                                                                                                                       "24.7", "42.1",\r
+                                                                                                                                                                                                                       "24.8", "42.1",\r
+                                                                                                                                                                                                                       56607427L);\r
+       public static osm_map_values            Czech_Republic                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Czech Republic",\r
+                                                                                                                                                                                                                       "11.91", "48.48",\r
+                                                                                                                                                                                                                       "19.02", "51.17",\r
+                                                                                                                                                                                                                       234138824L);\r
+       public static osm_map_values            Croatia                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Croatia", "13.4",\r
+                                                                                                                                                                                                                       "42.1", "19.4",\r
+                                                                                                                                                                                                                       "46.9", 99183280L);\r
+       public static osm_map_values            Estonia                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Estonia", "21.5",\r
+                                                                                                                                                                                                                       "57.5", "28.2",\r
+                                                                                                                                                                                                                       "59.6", 79276178L);\r
+       public static osm_map_values            Greece                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Greece", "28.9",\r
+                                                                                                                                                                                                                       "37.8", "29.0",\r
+                                                                                                                                                                                                                       "37.8", 55486527L);\r
+       public static osm_map_values            Crete                                                                                           = new osm_map_values(\r
+                                                                                                                                                                                                                       "Crete", "23.3",\r
+                                                                                                                                                                                                                       "34.5", "26.8",\r
+                                                                                                                                                                                                                       "36.0", 57032630L);\r
+       public static osm_map_values            Hungary                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Hungary",\r
+                                                                                                                                                                                                                       "16.08", "45.57",\r
+                                                                                                                                                                                                                       "23.03", "48.39",\r
+                                                                                                                                                                                                                       109831319L);\r
+       public static osm_map_values            Latvia                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Latvia", "20.7",\r
+                                                                                                                                                                                                                       "55.6", "28.3",\r
+                                                                                                                                                                                                                       "58.1", 71490706L);\r
+       public static osm_map_values            Lithuania                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Lithuania",\r
+                                                                                                                                                                                                                       "20.9", "53.8",\r
+                                                                                                                                                                                                                       "26.9", "56.5",\r
+                                                                                                                                                                                                                       67992457L);\r
+       public static osm_map_values            Poland                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Poland", "13.6",\r
+                                                                                                                                                                                                                       "48.8", "24.5",\r
+                                                                                                                                                                                                                       "55.0", 266136768L);\r
+       public static osm_map_values            Romania                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Romania", "20.3",\r
+                                                                                                                                                                                                                       "43.5", "29.9",\r
+                                                                                                                                                                                                                       "48.4", 134525863L);\r
+       public static osm_map_values            North_America                                                                   = new osm_map_values(\r
+                                                                                                                                                                                                                       "North America",\r
+                                                                                                                                                                                                                       "-178.1", "6.5",\r
+                                                                                                                                                                                                                       "-10.4", "84.0",\r
+                                                                                                                                                                                                                       2477309662L);\r
+       public static osm_map_values            Alaska                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Alaska",\r
+                                                                                                                                                                                                                       "-179.5", "49.5",\r
+                                                                                                                                                                                                                       "-129", "71.6",\r
+                                                                                                                                                                                                                       72320027L);\r
+       public static osm_map_values            Canada                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Canada",\r
+                                                                                                                                                                                                                       "-141.3", "41.5",\r
+                                                                                                                                                                                                                       "-52.2", "70.2",\r
+                                                                                                                                                                                                                       937813467L);\r
+       public static osm_map_values            Hawaii                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Hawaii",\r
+                                                                                                                                                                                                                       "-161.07",\r
+                                                                                                                                                                                                                       "18.49",\r
+                                                                                                                                                                                                                       "-154.45",\r
+                                                                                                                                                                                                                       "22.85", 57311788L);\r
+       public static osm_map_values            USA__except_Alaska_and_Hawaii_                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "USA (except Alaska and Hawaii)",\r
+                                                                                                                                                                                                                       "-125.4", "24.3",\r
+                                                                                                                                                                                                                       "-66.5", "49.3",\r
+                                                                                                                                                                                                                       2216912004L);\r
+       public static osm_map_values            Nevada                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Nevada",\r
+                                                                                                                                                                                                                       "-120.2", "35.0",\r
+                                                                                                                                                                                                                       "-113.8", "42.1",\r
+                                                                                                                                                                                                                       136754975L);\r
+       public static osm_map_values            Oregon                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Oregon",\r
+                                                                                                                                                                                                                       "-124.8", "41.8",\r
+                                                                                                                                                                                                                       "-116.3", "46.3",\r
+                                                                                                                                                                                                                       101627308L);\r
+       public static osm_map_values            Washington_State                                                                = new osm_map_values(\r
+                                                                                                                                                                                                                       "Washington State",\r
+                                                                                                                                                                                                                       "-125.0", "45.5",\r
+                                                                                                                                                                                                                       "-116.9", "49.0",\r
+                                                                                                                                                                                                                       98178877L);\r
+       public static osm_map_values            South_Middle_America                                                    = new osm_map_values(\r
+                                                                                                                                                                                                                       "South+Middle America",\r
+                                                                                                                                                                                                                       "-83.5", "-56.3",\r
+                                                                                                                                                                                                                       "-30.8", "13.7",\r
+                                                                                                                                                                                                                       159615197L);\r
+       public static osm_map_values            Argentina                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Argentina",\r
+                                                                                                                                                                                                                       "-73.9", "-57.3",\r
+                                                                                                                                                                                                                       "-51.6", "-21.0",\r
+                                                                                                                                                                                                                       87516152L);\r
+       public static osm_map_values            Argentina_Chile                                                         = new osm_map_values(\r
+                                                                                                                                                                                                                       "Argentina+Chile",\r
+                                                                                                                                                                                                                       "-77.2", "-56.3",\r
+                                                                                                                                                                                                                       "-52.7", "-16.1",\r
+                                                                                                                                                                                                                       91976696L);\r
+       public static osm_map_values            Bolivia                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Bolivia",\r
+                                                                                                                                                                                                                       "-70.5", "-23.1",\r
+                                                                                                                                                                                                                       "-57.3", "-9.3",\r
+                                                                                                                                                                                                                       58242168L);\r
+       public static osm_map_values            Brazil                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Brazil", "-71.4",\r
+                                                                                                                                                                                                                       "-34.7", "-32.8",\r
+                                                                                                                                                                                                                       "5.4", 105527899L);\r
+       public static osm_map_values            Cuba                                                                                            = new osm_map_values(\r
+                                                                                                                                                                                                                       "Cuba", "-85.3",\r
+                                                                                                                                                                                                                       "19.6", "-74.0",\r
+                                                                                                                                                                                                                       "23.6", 56608942L);\r
+       public static osm_map_values            Colombia                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Colombia",\r
+                                                                                                                                                                                                                       "-79.1", "-4.0",\r
+                                                                                                                                                                                                                       "-66.7", "12.6",\r
+                                                                                                                                                                                                                       78658454L);\r
+       public static osm_map_values            Ecuador                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Ecuador",\r
+                                                                                                                                                                                                                       "-82.6", "-5.4",\r
+                                                                                                                                                                                                                       "-74.4", "2.3",\r
+                                                                                                                                                                                                                       61501914L);\r
+       public static osm_map_values            Guyana_Suriname_Guyane_Francaise                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Guyana+Suriname+Guyane Francaise",\r
+                                                                                                                                                                                                                       "-62.0", "1.0",\r
+                                                                                                                                                                                                                       "-51.2", "8.9",\r
+                                                                                                                                                                                                                       57040689L);\r
+       public static osm_map_values            Haiti_Republica_Dominicana                                      = new osm_map_values(\r
+                                                                                                                                                                                                                       "Haiti+Republica Dominicana",\r
+                                                                                                                                                                                                                       "-74.8", "17.3",\r
+                                                                                                                                                                                                                       "-68.2", "20.1",\r
+                                                                                                                                                                                                                       63528584L);\r
+       public static osm_map_values            Jamaica                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Jamaica",\r
+                                                                                                                                                                                                                       "-78.6", "17.4",\r
+                                                                                                                                                                                                                       "-75.9", "18.9",\r
+                                                                                                                                                                                                                       53958307L);\r
+       public static osm_map_values            Mexico                                                                                  = new osm_map_values(\r
+                                                                                                                                                                                                                       "Mexico",\r
+                                                                                                                                                                                                                       "-117.6", "14.1",\r
+                                                                                                                                                                                                                       "-86.4", "32.8",\r
+                                                                                                                                                                                                                       251108617L);\r
+       public static osm_map_values            Paraguay                                                                                        = new osm_map_values(\r
+                                                                                                                                                                                                                       "Paraguay",\r
+                                                                                                                                                                                                                       "-63.8", "-28.1",\r
+                                                                                                                                                                                                                       "-53.6", "-18.8",\r
+                                                                                                                                                                                                                       57188715L);\r
+       public static osm_map_values            Peru                                                                                            = new osm_map_values(\r
+                                                                                                                                                                                                                       "Peru", "-82.4",\r
+                                                                                                                                                                                                                       "-18.1", "-67.5",\r
+                                                                                                                                                                                                                       "0.4", 65421441L);\r
+       public static osm_map_values            Uruguay                                                                                 = new osm_map_values(\r
+                                                                                                                                                                                                                       "Uruguay",\r
+                                                                                                                                                                                                                       "-59.2", "-36.5",\r
+                                                                                                                                                                                                                       "-51.7", "-29.7",\r
+                                                                                                                                                                                                                       63542225L);\r
+       public static osm_map_values            Venezuela                                                                               = new osm_map_values(\r
+                                                                                                                                                                                                                       "Venezuela",\r
+                                                                                                                                                                                                                       "-73.6", "0.4",\r
+                                                                                                                                                                                                                       "-59.7", "12.8",\r
+                                                                                                                                                                                                                       64838882L);\r
+\r
+       public static osm_map_values[]  OSM_MAPS                                                                                        = new osm_map_values[]{\r
                        Whole_Planet, Africa, Angola, Burundi, Democratic_Republic_of_the_Congo, Kenya, Lesotho,\r
                        Madagascar, Nambia_Botswana, Reunion, Rwanda, South_Africa, Uganda, Asia, China, Cyprus,\r
                        India_Nepal, Indonesia, Iran, Iraq, Israel, Japan_Korea_Taiwan, Malasia_Singapore,\r
@@ -438,8 +505,8 @@ public class NavitMapDownloader
                        USA__except_Alaska_and_Hawaii_, Nevada, Oregon, Washington_State, South_Middle_America,\r
                        Argentina, Argentina_Chile, Bolivia, Brazil, Cuba, Colombia, Ecuador,\r
                        Guyana_Suriname_Guyane_Francaise, Haiti_Republica_Dominicana, Jamaica, Mexico, Paraguay,\r
-                       Peru, Uruguay, Venezuela                                                                                                };\r
-       public static String[]                          OSM_MAP_NAME_LIST                                               = new String[]{\r
+                       Peru, Uruguay, Venezuela                                                                                                                };\r
+       public static String[]                          OSM_MAP_NAME_LIST                                                               = new String[]{\r
                        Whole_Planet.map_name, Africa.map_name, Angola.map_name, Burundi.map_name,\r
                        Democratic_Republic_of_the_Congo.map_name, Kenya.map_name, Lesotho.map_name,\r
                        Madagascar.map_name, Nambia_Botswana.map_name, Reunion.map_name, Rwanda.map_name,\r
@@ -463,38 +530,96 @@ public class NavitMapDownloader
                        Cuba.map_name, Colombia.map_name, Ecuador.map_name,\r
                        Guyana_Suriname_Guyane_Francaise.map_name, Haiti_Republica_Dominicana.map_name,\r
                        Jamaica.map_name, Mexico.map_name, Paraguay.map_name, Peru.map_name, Uruguay.map_name,\r
-                       Venezuela.map_name                                                                                                              };\r
-\r
-       public Boolean                                                  stop_me                                                                 = false;\r
-       static final int                                                SOCKET_CONNECT_TIMEOUT                          = 6000;\r
-       static final int                                                SOCKET_READ_TIMEOUT                                     = 6000;\r
-       static final int                                                MAP_WRITE_FILE_BUFFER                           = 1024 * 64;\r
-       static final int                                                MAP_WRITE_MEM_BUFFER                                    = 1024 * 64;\r
-       static final int                                                MAP_READ_FILE_BUFFER                                    = 1024 * 64;\r
-       static final int                                                UPDATE_PROGRESS_EVERY_CYCLE             = 8;\r
+                       Venezuela.map_name                                                                                                                              };\r
+\r
+       public static String[]                          OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE    = new String[]{\r
+                       Whole_Planet.text_for_select_list, Africa.text_for_select_list,\r
+                       Angola.text_for_select_list, Burundi.text_for_select_list,\r
+                       Democratic_Republic_of_the_Congo.text_for_select_list, Kenya.text_for_select_list,\r
+                       Lesotho.text_for_select_list, Madagascar.text_for_select_list,\r
+                       Nambia_Botswana.text_for_select_list, Reunion.text_for_select_list,\r
+                       Rwanda.text_for_select_list, South_Africa.text_for_select_list,\r
+                       Uganda.text_for_select_list, Asia.text_for_select_list, China.text_for_select_list,\r
+                       Cyprus.text_for_select_list, India_Nepal.text_for_select_list,\r
+                       Indonesia.text_for_select_list, Iran.text_for_select_list, Iraq.text_for_select_list,\r
+                       Israel.text_for_select_list, Japan_Korea_Taiwan.text_for_select_list,\r
+                       Malasia_Singapore.text_for_select_list, Mongolia.text_for_select_list,\r
+                       Nambia_Botswana.text_for_select_list, Thailand.text_for_select_list,\r
+                       Turkey.text_for_select_list, UAE_Other.text_for_select_list,\r
+                       Australia.text_for_select_list, Tasmania.text_for_select_list,\r
+                       Victoria_New_South_Wales.text_for_select_list, New_Zealand.text_for_select_list,\r
+                       Europe.text_for_select_list, Western_Europe.text_for_select_list,\r
+                       Austria.text_for_select_list, BeNeLux.text_for_select_list,\r
+                       Faroe_Islands.text_for_select_list, France.text_for_select_list,\r
+                       Germany.text_for_select_list, Bavaria.text_for_select_list, Saxonia.text_for_select_list,\r
+                       Germany_Austria_Switzerland.text_for_select_list, Iceland.text_for_select_list,\r
+                       Ireland.text_for_select_list, Italy.text_for_select_list,\r
+                       Spain_Portugal.text_for_select_list, Mallorca.text_for_select_list,\r
+                       Galicia.text_for_select_list, Scandinavia.text_for_select_list,\r
+                       Finland.text_for_select_list, Denmark.text_for_select_list,\r
+                       Switzerland.text_for_select_list, UK.text_for_select_list, Bulgaria.text_for_select_list,\r
+                       Czech_Republic.text_for_select_list, Croatia.text_for_select_list,\r
+                       Estonia.text_for_select_list, Greece.text_for_select_list, Crete.text_for_select_list,\r
+                       Hungary.text_for_select_list, Latvia.text_for_select_list, Lithuania.text_for_select_list,\r
+                       Poland.text_for_select_list, Romania.text_for_select_list,\r
+                       North_America.text_for_select_list, Alaska.text_for_select_list,\r
+                       Canada.text_for_select_list, Hawaii.text_for_select_list,\r
+                       USA__except_Alaska_and_Hawaii_.text_for_select_list, Nevada.text_for_select_list,\r
+                       Oregon.text_for_select_list, Washington_State.text_for_select_list,\r
+                       South_Middle_America.text_for_select_list, Argentina.text_for_select_list,\r
+                       Argentina_Chile.text_for_select_list, Bolivia.text_for_select_list,\r
+                       Brazil.text_for_select_list, Cuba.text_for_select_list, Colombia.text_for_select_list,\r
+                       Ecuador.text_for_select_list, Guyana_Suriname_Guyane_Francaise.text_for_select_list,\r
+                       Haiti_Republica_Dominicana.text_for_select_list, Jamaica.text_for_select_list,\r
+                       Mexico.text_for_select_list, Paraguay.text_for_select_list, Peru.text_for_select_list,\r
+                       Uruguay.text_for_select_list, Venezuela.text_for_select_list            };\r
+\r
+       public Boolean                                                  stop_me                                                                                 = false;\r
+       static final int                                                SOCKET_CONNECT_TIMEOUT                                          = 6000;\r
+       static final int                                                SOCKET_READ_TIMEOUT                                                     = 6000;\r
+       static final int                                                MAP_WRITE_FILE_BUFFER                                           = 1024 * 64;\r
+       static final int                                                MAP_WRITE_MEM_BUFFER                                                    = 1024 * 64;\r
+       static final int                                                MAP_READ_FILE_BUFFER                                                    = 1024 * 64;\r
+       static final int                                                UPDATE_PROGRESS_EVERY_CYCLE                             = 8;\r
+\r
+       static final String                                     DOWNLOAD_FILENAME                                                               = "navitmap.tmp";\r
+       static final String                                     MAP_FILENAME_PRI                                                                = "navitmap.bin";\r
+       static final String                                     MAP_FILENAME_SEC                                                                = "navitmap_002.bin";\r
+       static final String                                     MAP_FILENAME_PATH                                                               = "/sdcard/";\r
 \r
 \r
        public class ProgressThread extends Thread\r
        {\r
                Handler                 mHandler;\r
                osm_map_values  map_values;\r
+               int                             map_num;\r
+               int                             my_dialog_num;\r
 \r
-               ProgressThread(Handler h, osm_map_values map_values)\r
+               ProgressThread(Handler h, osm_map_values map_values, int map_num)\r
                {\r
                        this.mHandler = h;\r
                        this.map_values = map_values;\r
+                       this.map_num = map_num;\r
+                       if (this.map_num == Navit.MAP_NUM_PRIMARY)\r
+                       {\r
+                               this.my_dialog_num = Navit.MAPDOWNLOAD_PRI_DIALOG;\r
+                       }\r
+                       else if (this.map_num == Navit.MAP_NUM_SECONDARY)\r
+                       {\r
+                               this.my_dialog_num = Navit.MAPDOWNLOAD_SEC_DIALOG;\r
+                       }\r
                }\r
 \r
                public void run()\r
                {\r
                        stop_me = false;\r
-                       int exit_code = download_osm_map(mHandler, map_values);\r
+                       int exit_code = download_osm_map(mHandler, map_values, this.map_num);\r
 \r
                        // ok, remove dialog\r
                        Message msg = mHandler.obtainMessage();\r
                        Bundle b = new Bundle();\r
                        msg.what = 0;\r
-                       b.putInt("dialog_num", Navit.MAPDOWNLOAD_DIALOG);\r
+                       b.putInt("dialog_num", this.my_dialog_num);\r
                        b.putInt("exit_code", exit_code);\r
                        msg.setData(b);\r
                        mHandler.sendMessage(msg);\r
@@ -514,15 +639,26 @@ public class NavitMapDownloader
                this.navit_jmain = main;\r
        }\r
 \r
-       public int download_osm_map(Handler handler, osm_map_values map_values)\r
+       public int download_osm_map(Handler handler, osm_map_values map_values, int map_num)\r
        {\r
                int exit_code = 1;\r
 \r
+               int my_dialog_num = 0;\r
+               if (map_num == Navit.MAP_NUM_PRIMARY)\r
+               {\r
+                       my_dialog_num = Navit.MAPDOWNLOAD_PRI_DIALOG;\r
+               }\r
+               else if (map_num == Navit.MAP_NUM_SECONDARY)\r
+               {\r
+                       my_dialog_num = Navit.MAPDOWNLOAD_SEC_DIALOG;\r
+               }\r
+\r
                Message msg = handler.obtainMessage();\r
                Bundle b = new Bundle();\r
                msg.what = 1;\r
                b.putInt("max", 20); // use a dummy number here\r
                b.putInt("cur", 0);\r
+               b.putInt("dialog_num", my_dialog_num);\r
                b.putString("title", "Mapdownload");\r
                b.putString("text", "downloading: " + map_values.map_name);\r
                msg.setData(b);\r
@@ -537,11 +673,15 @@ public class NavitMapDownloader
                }\r
 \r
                // output filename\r
-               String fileName = "navitmap.tmp";\r
-               String final_fileName = "navitmap.bin";\r
+               String fileName = DOWNLOAD_FILENAME;\r
+               String final_fileName = MAP_FILENAME_PRI;\r
+               if (map_num == Navit.MAP_NUM_SECONDARY)\r
+               {\r
+                       final_fileName = this.MAP_FILENAME_SEC;\r
+               }\r
                // output path for output filename\r
                // String PATH = Environment.getExternalStorageDirectory() + "/download/";\r
-               String PATH = "/sdcard/";\r
+               String PATH = MAP_FILENAME_PATH;\r
                Log.v("log_tag", "mapfilename tmp: " + PATH + fileName);\r
 \r
                try\r
@@ -612,6 +752,7 @@ public class NavitMapDownloader
                                        msg.what = 1;\r
                                        b.putInt("max", (int) (map_values.est_size_bytes / 1024));\r
                                        b.putInt("cur", (int) (already_read / 1024));\r
+                                       b.putInt("dialog_num", my_dialog_num);\r
                                        b.putString("title", "Map download");\r
                                        per_second_overall = (float) already_read\r
                                                        / (float) ((System.currentTimeMillis() - start_timestamp) / 1000);\r
@@ -663,6 +804,7 @@ public class NavitMapDownloader
                        msg = handler.obtainMessage();\r
                        b = new Bundle();\r
                        msg.what = 2;\r
+                       b.putInt("dialog_num", my_dialog_num);\r
                        b.putString("text", "Error downloading map!");\r
                        msg.setData(b);\r
                        handler.sendMessage(msg);\r
@@ -675,6 +817,7 @@ public class NavitMapDownloader
                        msg = handler.obtainMessage();\r
                        b = new Bundle();\r
                        msg.what = 2;\r
+                       b.putInt("dialog_num", my_dialog_num);\r
                        b.putString("text", "Error downloading map!");\r
                        msg.setData(b);\r
                        handler.sendMessage(msg);\r
@@ -688,6 +831,7 @@ public class NavitMapDownloader
                msg.what = 1;\r
                b.putInt("max", (int) (map_values.est_size_bytes / 1024));\r
                b.putInt("cur", (int) (map_values.est_size_bytes / 1024));\r
+               b.putInt("dialog_num", my_dialog_num);\r
                b.putString("title", "Mapdownload");\r
                b.putString("text", map_values.map_name + " ready");\r
                msg.setData(b);\r