只查看谷歌地图 [英] Only view the map of google maps

查看:91
本文介绍了只查看谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个查看Google地图的表单,但是
问题在于它现在正在显示整个Google Maps网页.
我只想查看地图,谁能帮我
请出来.

任何建议都将适用..

[根据评论更新的OP的代码]

Hi,

I created a form viewing google maps fine, but
the problem is it is showing the whole google maps webpage now.
I only want it to view the map , can anyone help me
out with this please.

Any suggestion would be appriciated..

[Update-added OP''s code as per comment]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MapAddress
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnMapAddress_Click(object sender, EventArgs e)
        {
            try
            {
                string street = string.Empty;
                string city = string.Empty;
                string state = string.Empty;
                string zip = string.Empty;

                StringBuilder queryAddress = new StringBuilder();
                queryAddress.Append("http://maps.google.com/maps?q=");

                if (txtStreet.Text != string.Empty)
                {
                    street = txtStreet.Text.Replace('' '', ''+'');
                    queryAddress.Append(street + '','' + ''+'');
                }

                if (txtCity.Text != string.Empty)
                {
                    city = txtCity.Text.Replace('' '', ''+'');
                    queryAddress.Append(city + '','' + ''+'');
                }

                if (txtState.Text != string.Empty)
                {
                    state = txtState.Text.Replace('' '', ''+'');
                    queryAddress.Append(state + '','' + ''+'');
                }

                if (txtZipCode.Text != string.Empty)
                {
                    zip = txtZipCode.Text.ToString();
                    queryAddress.Append(zip);
                }

                webBrowser1.Navigate(queryAddress.ToString());

            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Unable to Retrieve Map");
            }
        }
    }
}

推荐答案

您可能可以根据应用程序使用它.每天可以进行的请求数量有限制.

否则,您可以使用免费的OpenStreetMap或为Google或Bing地图付费,但这是相当昂贵的...

Google静态地图 [
You might be able to use that depending of your application. There is a limit on the number of request that can be made per day.

Otherwise, you can uses OpenStreetMap which is free or pay for Google or Bing maps but this is quite expensive...

Google Static Maps[^]


这篇关于只查看谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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