Home > Web Front-end > HTML Tutorial > 网页中调用Google地图_html/css_WEB-ITnose

网页中调用Google地图_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:36:23
Original
1103 people have browsed it

 

 

无标题文档

 

 

 

 

                            

 

 

 

 

 

     function wb() {

         if (GBrowserIsCompatible()) {

             var map = new GMap2(document.getElementById_x_x("webmap"));

             // map.setCenter(new GLatLng(88, 99), 11);

             map.setCenter(new GLatLng(34.613785, 112.422023), 13);

             //设置中心经纬度(此处为北京的经纬度)和地图放大级数

             map.enableScrollWheelZoom();

 

             var center = new GLatLng(34.613785, 112.422023); //创建一个坐标

             var marker = new GMarker(center, { draggable: false });

             marker.openInfoWindowHtml("

洛阳理工学院
");

             map.addOverlay(marker);

 

             map.addControl(new GMapTypeControl());              //添加地图类型切换控件(如卫星图到二维地图的切换控件)

 

             map.addControl(new GLargeMapControl());             //添加有滑块的地图导航控件

 

             map.addControl(new GOverviewMapControl());          //添加鹰眼控件

 

             //map.enableGoogleBar();    

         }

     }

  

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template