private void DownloadData()
 {
     try
     {
         WebClient client = new WebClient();
         client.DownloadFile("http://opendata.mpn.gov.rs/get.php?dataset=skole&lang=sr&term=json", "data.json");
         File.Copy("data.json", "kes.json", true);
     }
     catch
     {
         MessageBox.Show(vocab.Error("downloadData"));
         File.Copy("kes.json", "data.json", true);
     }
 }
Beispiel #2
0
        public Map(List <Skola> Data)
        {
            this.Data = Data;
            InitializeComponent();
            RefreshVocab();
            try { System.Net.IPHostEntry e = System.Net.Dns.GetHostEntry("www.google.com"); }
            catch
            {
                MainMap.Manager.Mode = AccessMode.CacheOnly;
                MessageBox.Show(
                    vocab.Error("downloadData"),
                    vocab.map,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning
                    );
            }

            // config map
            MainMap.MapProvider    = GMapProviders.OpenStreetMap;
            MainMap.Position       = new PointLatLng(44.735027899515465, 20.533447265625);
            MainMap.MinZoom        = 0;
            MainMap.MaxZoom        = 24;
            MainMap.Zoom           = 9;
            MainMap.OnMarkerClick += new MarkerClick(MainMap_OnMarkerClick);
        }