如何在Asp.Net项目中包含Google Maps [英] How To Include Google Maps In Asp.Net Project

查看:61
本文介绍了如何在Asp.Net项目中包含Google Maps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道如何将Google Maps添加到我的asp.net网站中吗?实际上,它应该动态地指向特定的位置.即,当数据列表中显示特定的大学或医院时,Google地图应动态指向该特定的医院或大学...

May I know how to add Google Maps into my asp.net website. Actually it should point to a particular place dynamically. i.e.. When there is a particular college or hospital displayed in the datalist, The google map should point to that particular hospital or college Dynamically...

推荐答案

关于如何做到这一点的好文章:

用于ASP.NET的Google Maps API V3 [ ^ ]

这是另一个:

http://gathadams.com/2007 /08/21/add-google-maps-to-your-net-site-in-10-minutes/ [
Here is a great article on how to do that:

Google Maps API V3 for ASP.NET[^]

Here is another:

http://gathadams.com/2007/08/21/add-google-maps-to-your-net-site-in-10-minutes/[^]

This second one shows you how, step by step, to add a map to your page and point it to an address. You would just need to change it to update the address based upon the users'' interaction.


<div id="mapsearch">
    <span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span>
  </div>

  <!-- Maps Api, Ajax Search Api and Stylesheet
  // Note: If you are already using the Maps API then do not include it again
  //       If you are already using the AJAX Search API, then do not include it
  //       or its stylesheet again
  //
  // The Key Embedded in the following script tags is designed to work with
  // the following site:
  // http://www.abhilashaengineering.com
  -->
  <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjfewZCwoKLTq3HmI_i3FYBQIrbY-MYJHVPV3NhA9XUpGkb0yzhRskeXa2xR_0Y55q4MAqbDm5loJxw">
    type="text/javascript"></script>
  <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-msw&key=ABQIAAAAjfewZCwoKLTq3HmI_i3FYBQIrbY-MYJHVPV3NhA9XUpGkb0yzhRskeXa2xR_0Y55q4MAqbDm5loJxw">
    type="text/javascript"></script>
  <style type="text/css">
    @import url("http://www.google.com/uds/css/gsearch.css");
  </style>

  <!-- Map Search Control and Stylesheet -->
  <script type="text/javascript">
    window._uds_msw_donotrepair = true;
  </script>
  <script src="http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js?mode=new">
    type="text/javascript"></script>
  <style type="text/css">
    @import url("http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css");
  </style>

  <style type="text/css">
    .gsmsc-mapDiv {
      height : 300px;
    }

    .gsmsc-idleMapDiv {
      height : 300px;
    }

    #mapsearch {
      width : 550px;
      margin: 10px;
      padding: 4px;
    }
  </style>
  <script type="text/javascript">
    function LoadMapSearchControl() {

      var options = {
            zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
            title : "Googleplex",
            url : "http://www.google.com/corporate/index.html",
            idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM,
            activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM
            }

      new GSmapSearchControl(
            document.getElementById("mapsearch"),
            "1600 Amphitheatre Parkway, Mountain View, CA",
            options
            );

    }
    // arrange for this function to be called during body.onload
    // event processing
    GSearch.setOnLoadCallback(LoadMapSearchControl);
  </script>
<!-- ++End Map Search Control Wizard Generated Code++ -->


这篇关于如何在Asp.Net项目中包含Google Maps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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