Hi Team
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
- {
- // GET: Maps
- 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();
- }
- }
- }
- @{
- ViewBag.Title = "GoogleMaps";
- Layout = null;
- }
- "viewport" content="width=device-width"/>
-
eNtsa Office Location - "dvMap" style="width: 500px; height: 500px">
Guest UserPosted Mar 11, 2020, 1:18 AM
Amit MohantyPosted Mar 10, 2020, 11:36 PM
Please update your database with the above value and try again.
Guest UserPosted Mar 10, 2020, 8:16 AM
Guest UserPosted Mar 10, 2020, 8:07 AM
Laxmidhar SahooPosted Mar 10, 2020, 8:01 AM
Amit MohantyPosted Mar 10, 2020, 7:58 AM