我要投稿
  • 您当前的位置:57365.com -> 技术教程 -> 网站建设教程 -> 建站交流 -> 教程内容
  • [ 收藏本页教程 ]
  • Google Map 代码建站交流教程

    教程作者:佚名    教程来源:不详   教程栏目:建站交流    收藏本页
    演示:http://www.ivucc.com/blog/googlemap.htm 我网站付有Google Maps API 详细说明 这里不能贴html 编下去太麻烦了

    http://www.ivucc.com/blog/uploads/200508/12_153021_spximage1234111.jpg');}" src="http://www.ivucc.com/blog/uploads/200508/12_153021_spximage1234111.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <script src="/images/mapsgooglecommapsfileapi&v1&keyABQIAAAAldeplnSa046Mgs42FWv1vxSzB1HpiWZ7bOrz1NckBd6pSmH0tBQ-3-pJ2Wlqv7eA95U9YxBebInG2g.js" type="text/javascript"></script>
      </head>
      <body>
        <div id="map" style="width: 500px; height: 400px"></div> /#地图大小
        <script type="text/javascript">
        //<![CDATA[
       
        var map = new GMap(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
       
        //]]>
        </script>
      </body>
    </html>

    ABQIAAAAldeplnSa046Mgs42FWv1vxSzB1HpiWZ7bOrz1NckBd6pSmH0tBQ-3-pJ2Wlqv7eA95U9YxBebInG2g" 这个是我网站的key
    key要去http://www.google.com/apis/maps/signup.html申请!
    登陆用GMAIL就可以了

      <script type="text/javascript">
        //<![CDATA[
       
        var map = new GMap(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
       
        //]]>
        </script>

    这个可以该坐标~
    我的看你做参考

      CODE:[Copy to clipboard]  <script type="text/javascript">
        //<![CDATA[
        function onLoad() {
            // Center the map on Beijing
        var map = new GMap(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
        map.centerAndZoom(new GPoint(116.416, 39.916), 13);

        var BeijingStation = new GMarker (new GPoint (116.416,39.916));
            GEvent.addListener (BeijingStation, "click", function() {
            BeijingStation.openInfoWindowHtml ("北京-中国的首都");
             });
                     map.addOverlay (BeijingStation);

                     map.openInfoWindow(map.getCenterLatLng(),
                       document.createTextNode("MSN space~!googlemap插件"));


            // Center the map on Smilingfish
        var SmilingfishStation = new GMarker (new GPoint (117.35,24.516));
            GEvent.addListener (SmilingfishStation, "click", function() {
            SmilingfishStation.openInfoWindowHtml ("[福建]福建地区 googlemap<br>广告出租");
             });
                     map.addOverlay (SmilingfishStation);


            // Center the map on Liuyue
        var LiuyueStation = new GMarker (new GPoint (104.066,30.66));
            GEvent.addListener (LiuyueStation, "click", function() {
            LiuyueStation.openInfoWindowHtml ("[四川重庆]鱼是不是在这个地方?");
             });
                     map.addOverlay (LiuyueStation);
            // Center the map on Huoxian
        var HuoxianStation = new GMarker (new GPoint (113,28.2166));
            GEvent.addListener (HuoxianStation, "click", function() {
            HuoxianStation.openInfoWindowHtml ("[湖南长沙]<br />超级女生~");
             });
                     map.addOverlay (HuoxianStation);

            // Center the map on Wuyi
        var WuyiStation = new GMarker (new GPoint (116.4,39.9));
            GEvent.addListener (WuyiStation, "click", function() {
            WuyiStation.openInfoWindowHtml ("[北京海淀]<br /> 刘亦菲 你在吗?");
             });
                     map.addOverlay (WuyiStation);       

            // Center the map on Wuyi2
        var Wuyi2Station = new GMarker (new GPoint (108.3,22.8));
            GEvent.addListener (Wuyi2Station, "click", function() {
            Wuyi2Station.openInfoWindowHtml ("[广西南宁]<br />美女很多~~~");
             });
                     map.addOverlay (Wuyi2Station);       
                     
            //绘制线条
            var points = [new GPoint (116.416,39.916), new GPoint (112.533,37.866), new GPoint (117.35,24.516), new GPoint (113,28.2166),new GPoint (104.066,30.66),new GPoint (108.3,22.8)];
            var line = new GPolyline(points, "#ff0000");
        map.addOverlay(line);       

                     }
                     //]]>
       </script>

    (出处:

    我要投稿   -   广告合作   -   关于本站   -   友情连接   -   网站地图   -   联系我们   -   版权声明   -   设为首页   -   加入收藏   -   网站留言
    Copyright © 2009 - 20012 www.www.hxswjs.com All Rights Reserved.57365.com 版权所有