I need some help, my google app does not show correctly my current location, it must show South Africa, Port Elizabeth. But currently these co-ordinates are far from the continent in Africa which is not good for a user to see this, please help.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.Data.SqlClient;
- using System.Configuration;
-
- namespace eNtsaRegistrationTraining.Controllers
- {
- public class MapsController : Controller
- {
-
- public ActionResult GoogleMaps()
- {
- string markers = "[";
- string conString = ConfigurationManager.ConnectionStrings["eNtsaRegistration"].ConnectionString;
- SqlCommand cmd = new SqlCommand("SELECT * FROM Locations");
- using (SqlConnection con = new SqlConnection(conString))
- {
- cmd.Connection = con;
- con.Open();
- using(SqlDataReader sdr = cmd.ExecuteReader())
- {
- while(sdr.Read())
- {
- markers += "{";
- markers += string.Format("'title': '{0}',", sdr["Name"]);
- markers += string.Format("'lat': '{0}',", sdr["Latitute"]);
- markers += string.Format("'lng': '{0}',", sdr["Longitute"]);
- markers += string.Format("'description': '{0}',", sdr["Description"]);
- markers += "},";
- }
- }
- con.Close();
- }
-
- markers += "];";
- ViewBag.Markers = markers;
-
- return View();
- }
- }
- }