private void InicializarDatos()
        {
            SerializadorJson Serializador = SerializadorJson.GetInstancia();

            object[] objetosResultante = (object[])Serializador.GetDatosDelArchivoJson("Lugares");

            for (int i = 0; i < objetosResultante.Length; i++)
            {
                Dictionary <string, object> datos = (Dictionary <string, object>)objetosResultante[i];
                GMarkerGoogle Marcador            = new GMarkerGoogle(new PointLatLng(Convert.ToDouble(datos["Latitud"]), Convert.ToDouble(datos["Longitud"])), GMarkerGoogleType.green);
                Marcador.ToolTipMode = MarkerTooltipMode.OnMouseOver;
                Marcador.ToolTip     = new GMapRoundedToolTip(Marcador);
                Brush ColorFondoInformacion = new SolidBrush(Color.Blue);
                Font  letra = new Font("Arial", 12, FontStyle.Bold);
                ColorFondoInformacion.GetType();
                Marcador.ToolTip.Stroke.Color = Color.Red;
                Marcador.ToolTip.TextPadding  = new Size(5, 10);
                Marcador.ToolTip.Font         = letra;
                Marcador.ToolTip.Fill         = ColorFondoInformacion;
                ColorFondoInformacion         = new SolidBrush(Color.White);
                Marcador.ToolTip.Foreground   = ColorFondoInformacion;
                Marcador.ToolTipText          = String.Format(" \n" + datos["Nombre"].ToString());

                Marcador.Tag = datos["Nombre"];
                this.gMapControl1.Overlays[1].Markers.Add(Marcador);
                this.Gestor.InsertarVertice(datos["Nombre"].ToString(), Convert.ToDouble(datos["Longitud"]), Convert.ToDouble(datos["Latitud"]));
            }
            MarcartRutas();
        }
Exemplo n.º 2
0
        private void rbtnJson_Click(object sender, EventArgs e)
        {
            var sfd = new SaveFileDialog()
            {
                Filter = "*.json|*.json"
            };

            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                SerializadorJson.SerializarJson(Global.Historico, new FileInfo(sfd.FileName));
                MessageBox.Show("Salvo com sucesso!");
            }
            catch (Exception exception)
            {
                exception.Show();
            }
        }