Click here to Skip to main content
16,012,843 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Can anyone help me how to show markers on Google map with respect to its longitude n latitude? Scenario is user ADD an Event with (Name,description,city,country,Picture,longitude & Latitude) And if we click on the marker we see the the event details of the particular marker we have clicked?(details will open on another page) using C#,SQL2008,ASP.NET..............



Please help Me
Posted
Updated 24-Nov-13 3:23am
v2

1 solution

 
Share this answer
 
Comments
S.M.Arsalan 24-Nov-13 12:19pm    
Yes Sir i have seen this all before but i need to place all details which are coming from the database tables? When every time Event is added by the Guest its marker will automatically shown on the Map?
Kornfeld Eliyahu Peter 24-Nov-13 12:29pm    
In that case I do not understand you. You have problem to put marker on google map or to bring data from DB?
S.M.Arsalan 24-Nov-13 14:58pm    
Bring data to show on marker Sir
Kornfeld Eliyahu Peter 24-Nov-13 15:03pm    
Please don't address me Sir. I never been knighted...
Can you show me what you have tried so far to bring your data from the SQL?
S.M.Arsalan 24-Nov-13 15:14pm    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace FindEvent
{
public partial class map2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!this.IsPostBack)
//{
// DataTable dt = this.GetData("select * from Locations");
// rptMarkers.DataSource = dt;
// rptMarkers.DataBind();
//}
}

protected void UpdatePanel1_Load(object sender, EventArgs e)
{
//Linq is used to load the table to the code
GoogleDataClassesDataContext data = new GoogleDataClassesDataContext();

//Select all from the table
List<city> lst = (from u in data.City select u).ToList();

//add the table contents to the javascript array so that new locations will be loaded
foreach (City item in lst)
{
ScriptManager.RegisterArrayDeclaration(UpdatePanel1, "infoarray", "'" + item.C_ID.ToString() + "'");
ScriptManager.RegisterArrayDeclaration(UpdatePanel1, "lonarray", item.Longitude.ToString());
ScriptManager.RegisterArrayDeclaration(UpdatePanel1, "latarray", item.Latitude.ToString());
ScriptManager.RegisterArrayDeclaration(UpdatePanel1, "bounce", item.Bounce.ToString());
}
}

protected void Timer1_Tick(object sender, EventArgs e)
{

//update the update panel every 10 seconds
UpdatePanel1.Update();
}
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900