Click here to Skip to main content
15,923,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im using google map control in my ASP.NET project, i have added the control assembly to my bin folder inn the project directory using visual studio, but when viewing it in the map, the map content does not display but only show the zoom control. here is the code. help me out please.

C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!Request.IsAuthenticated)
    {
        Response.Redirect("~/Login.aspx");
    }

    if (string.IsNullOrWhiteSpace(Request.QueryString["latitude"]) && string.IsNullOrWhiteSpace(Request.QueryString["longitude"]))
    {
        lblError1.Font.Size = 18;
        lblError1.Text = "The selected vehicle has not arquired a GPS coordinate fix";
    }

    else
    {
        string querylat = Request.QueryString["latitude"];
        string querylongt = Request.QueryString["longitude"];
        double value1 = double.Parse(querylat);
        double value2 = double.Parse(querylongt);

        Artem.Web.UI.Controls.GoogleMap GistMeEnforaMap = new GoogleMap();
        GistMeEnforaMap.Visible = true;
        GistMeEnforaMap.Enabled = true;
        GistMeEnforaMap.Zoom = 10;
        GistMeEnforaMap.Height = 600;
        GistMeEnforaMap.Width = 800;
        GistMeEnforaMap.EnableGoogleBar = true;
        GistMeEnforaMap.Key = "My googlemap key goes in here";
        GoogleMarker marker = new GoogleMarker(value1, value2);
        GistMeEnforaMap.Markers.Add(marker);
        GistMeEnforaMap.Latitude = marker.Latitude;
        GistMeEnforaMap.Longitude = marker.Longitude;
        GistMeEnforaMap.DefaultAddress = "Abuja, Nigeria";
        GistMeEnforaMap.DefaultMapView = GoogleMapView.Hybrid;
        PanelEnforaMap.Controls.Add(GistMeEnforaMap);

        //GistMeEnforaMap.Markers.Add(new GoogleMarker(value1, value2));
        //GistMeEnforaMap.Latitude = value1;
        //GistMeEnforaMap.Longitude = value2;
    }
}
Posted
Updated 18-Oct-11 0:19am
v2
Comments
Slacker007 18-Oct-11 6:19am    
Edit: Code formatting.

1 solution

Hi,

Check this article

Google Maps in HTML, ASP.NET, PHP, JSP etc. with ease[^]

Thanks...
 
Share this answer
 

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