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">

Amit MohantyRank #112 · 20K reputationPosted Mar 10, 2020, 7:36 PM EDT
Please update your database with the above value and try again.
Amit MohantyRank #112 · 20K reputationPosted Mar 10, 2020, 3:58 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Mar 10, 2020, 4:01 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 10, 2020, 4:07 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 10, 2020, 4:16 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 10, 2020, 9:18 PM EDT