/* JavaScript Document * Author: Tony * Date: 2014-10-16 */ /* * DEMO:引入 http://api.map.baidu.com/api?v=2.0&ak=7d3a4c6e5e8a70dd200a2eeacf8c1b50 * 百度地图应用 * 引入publictools.js置于 前 * 初始化参数 var baidumap=new BaiduMap({ MapContainer:'Maps', StyleName:'light', //地图的图层遮挡物的样式 ZoomLevel:17, //地图缩放等级 19最大 CenterLongitude:'104.075249,30.540917', //初始化地图中心坐标 CurentLongitude:'104.075249,30.540917', //当前坐标 isanimation:false, //坐标点是否动画 默认关闭 enableScrollWheelZoom:false,//是否开启地图滚轮,默认关闭 IsopenInfoWindow:true // 是否开启提示窗口 默认打开 infowidth:270, //提示窗口宽度 infoheight:80, //提示窗口高度 imgurl:'', //坐标图标地址,相对绝对皆可 iconimgwidth:25, //图标宽度 iconimgheight:25, //图标高度 titles:'赛门仕博',//图标title提示。 infotitle:'赛门仕博', //提示窗口标题 infocontent:'

地址:天府大道中段1388号美年广场A座7楼746
查看公交地址

' //提示窗口内容不符,支持html。 }); * * * */ function TonyBaiduMap(options) { //默认参数 var defaults = { MapContainer: '', StyleName: 'light', ZoomLevel: 17, CenterLongitude: '104.075249,30.540917', CurentLongitude: '104.075249,30.540917', isanimation: false, enableScrollWheelZoom: false, IsopenInfoWindow: true, infowidth: 270, infoheight: 80, imgurl: '', iconimgwidth: 25, iconimgheight: 25, titles: '赛门仕博', infotitle: '赛门仕博', infocontent: '

地址:天府大道中段1388号美年广场A座7楼746
查看公交地址

' }; this.init = function () { for (var p in options) { if (options.hasOwnProperty(p)) { defaults[p] = options[p]; } } } //初始化 this.init(); var map = new BMap.Map(defaults.MapContainer); //设置颜色 map.setMapStyle({ features: ["road", "building", "water", "land"], style: defaults.StyleName }); //创建地图实例 map.centerAndZoom(new BMap.Point(Number(defaults.CenterLongitude.split(',')[0]), Number(defaults.CenterLongitude.split(',')[1])), defaults.ZoomLevel); var _marker; if (defaults.imgurl != '') { _marker = new BMap.Marker(new BMap.Point(Number(defaults.CurentLongitude.split(',')[0]), Number(defaults.CurentLongitude.split(',')[1])), { icon: new BMap.Icon(defaults.imgurl, new BMap.Size(defaults.iconimgwidth, defaults.iconimgheight)) }) } else { _marker = new BMap.Marker(new BMap.Point(Number(defaults.CurentLongitude.split(',')[0]), Number(defaults.CurentLongitude.split(',')[1]))); } _marker.setTitle(defaults.titles); //设置title if (defaults.isanimation) { _marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画 }; var infoWindow = new BMap.InfoWindow(defaults.infocontent, { width: defaults.infowidth, height: defaults.infoheight, title: defaults.infotitle }); // 创建信息窗口对象 _marker.addEventListener("click", function () { this.openInfoWindow(infoWindow); }); map.addOverlay(_marker); //是否自动开启提示信息; if (defaults.IsopenInfoWindow) { _marker.openInfoWindow(infoWindow); } if (defaults.enableScrollWheelZoom) map.enableScrollWheelZoom(); map.disableScrollWheelZoom(); // 开启鼠标滚轮缩放 map.enableKeyboard(); // 开启键盘控制 map.enableContinuousZoom(); // 开启连续缩放效果 map.enableInertialDragging(); // 开启惯性拖拽效果 map.addControl(new BMap.NavigationControl()); // 添加平移缩放控件 map.addControl(new BMap.ScaleControl()); //添加地图类型控件 map.addControl(new BMap.MapTypeControl()); // 添加比例尺控件 map.addControl(new BMap.OverviewMapControl()); //添加缩略地图控件 } /* 关于分享API 引入jquery.js,player.mini.js置于 前 分享更多 share 新浪微博 tsina QQ空间 qzone 微信 weixin 腾讯微博 tqq 人人网 renren 搜狐微博 tsohu 飞信 feixin 开心网 kaixin001 QQ好友 cqq 淘江湖 taobao 百度贴吧 tieba 豆瓣 douban 网易微博 t163 易信 yixin 蘑菇街 mogujie 百度搜藏 baidu MSN msn 朋友网 xiaoyou 美丽说 meilishuo 百度空间 hi Facebook fb 手机快传 189share 天涯社区 tianya eg:TonyShare.ShareWebSite('tsina', $('.tsina1')); eg: TonyShare.SharePic($(this).attr('class'), $(this), $(this).siblings(':first')); */ var TonyShare = { ShareWebSite: function (shareplatform, shareobj) { shareobj.click(function () { shareobj.attr('href', 'http://www.jiathis.com/send/?webid=' + shareplatform + '&url=' + location.href + '&title=' + document.title + '&summary=' + jQuery('meta[name="description"]').attr('content') + ''); return true; }); }, SharePic: function (shareplatform, shareobj, picobj) { shareobj.click(function () { shareobj.attr('href', 'http://www.jiathis.com/send/?webid=' + shareplatform + '&url=' + location.href + '&title=' + document.title + '&pic=http://' + location.hostname + picobj.attr("src") + '&summary=' + jQuery('meta[name="description"]').attr('content') + ''); return true; }); } } /* 关于视频播放器 引入jquery.js,player.mini.js置于 前 -------------------------------------------- var vobj = Video.load({ vcontainer: 'videocontainer', //视频容器 vfiles: 'testvideo/about.mp4', //视频地址 vfimg: 'img/v1.jpg' //视频缩略图(封面) }); -------------------------------------------- */ var TonyVideo = { load: function (objs) { var objplay = jwplayer(objs.vcontainer).setup({ flashplayer: 'js/video/flashplay.swf', html5player: 'js/video/html5player.js', file: objs.vfiles, image: objs.vfimg, width: '100%', height: '100%', aspectratio: '16:9', stretching: 'fill', controls: 'true', autostart: objs.isautoplay }); return objplay; } }