2
2
< script src ="../assets/bootstrap/js/bootstrap.min.js "> </ script >
3
3
< script src ="../js/wow.min.js "> </ script >
4
4
< script >
5
- new WOW ( ) . init ( ) ;
5
+ new WOW ( ) . init ( ) ;
6
+ // // 百度地图API功能
7
+ // var map = new BMap.Map("map_container"); // 创建Map实例
8
+ // map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); // 初始化地图,设置中心点坐标和地图级别
9
+ // //添加地图类型控件
10
+ // map.addControl(new BMap.MapTypeControl({
11
+ // mapTypes:[
12
+ // BMAP_NORMAL_MAP,
13
+ // BMAP_HYBRID_MAP
14
+ // ]}));
15
+ // map.setCurrentCity("北京"); // 设置地图显示的城市 此项是必须设置的
16
+ // map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
17
+
18
+ function loadJScript ( ) {
19
+ var script = document . createElement ( 'script' ) ;
20
+ script . type = 'text/javascript' ;
21
+ script . src = '//api.map.baidu.com/api?type=webgl&v=1.0&ak=oZ5ONlBBSuVIrz7WWdHdaw4g1zYOB3G6&callback=init' ;
22
+ document . body . appendChild ( script ) ;
23
+ }
24
+
25
+ function init ( ) {
26
+ var map = new BMapGL . Map ( 'map_container' ) ; // 创建Map实例
27
+ var point = new BMapGL . Point ( 116.465808 , 39.91327 ) ; // 创建点坐标
28
+ // var icon = new BMapGL.Icon("http://app.baidu.com/map/images/us_mk_icon.png", new BMap.Size(json.w,json.h);
29
+ map . centerAndZoom ( point , 18 ) ;
30
+ map . enableScrollWheelZoom ( ) ; // 启用滚轮放大缩小
31
+
32
+ var marker = new BMapGL . Marker ( point , {
33
+ enableDragging : true
34
+ } ) ;
35
+ // var icon = new BMapGL.Icon("assets/img/slider/sign-310036_1280.png", new BMapGL.Size(50, 30));
36
+ // var marker = new BMapGL.Marker(point, {
37
+ // icon: icon
38
+ // });
39
+ map . addOverlay ( marker ) ;
40
+ }
41
+ window . onload = loadJScript ; // 异步加载地图
6
42
</ script >
0 commit comments