帮助在ASP.NET中显示Google地图 [英] Help with displaying of google map in ASP.NET

查看:53
本文介绍了帮助在ASP.NET中显示Google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的ASP.NET项目中使用google map控件,我已使用Visual Studio将控件程序集添加到项目目录中我的bin文件夹中,但是在地图中查看它时,地图内容不显示而仅显示缩放控件.这是代码.请帮帮我.

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.

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;
    }
}

推荐答案



检查这篇文章

轻松使用HTML,ASP.NET,PHP,JSP等格式的Google Maps [
Hi,

Check this article

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

Thanks...


这篇关于帮助在ASP.NET中显示Google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆