var address = $('#info .address span').html();
if(address == "") {
$('#info .address').hide();
}
function map(x,y,tit) {
// 百度地圖API功能
var map = new BMap.Map('allmap');
var poi = new BMap.Point(x,y);
map.centerAndZoom(poi, 16);
map.enableScrollWheelZoom();
var content = tit;
//創(chuàng)建檢索信息窗口對象
var searchInfoWindow = null;
searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
//title: "上海和蘇信息科技有限公司", //標(biāo)題
panel : "panel", //檢索結(jié)果面板
width : 290, //寬度
height : 40, //高度
enableAutoPan : true, //自動(dòng)平移
searchTypes :[
BMAPLIB_TAB_TO_HERE, //從這里出發(fā)
BMAPLIB_TAB_SEARCH //周邊檢索
]
});
var marker = new BMap.Marker(poi); //創(chuàng)建marker對象
marker.enableDragging(); //marker可拖拽
marker.addEventListener("click", function(e){
searchInfoWindow.open(marker);
})
map.addOverlay(marker); //在地圖中添加marker
if($(window).width()<=768){
scrollTo("#map_wrap",0);
}
}
if($(window).width() > 768) {
$('.contact_index .txt li:eq(4),.contact_index .txt li:eq(5)').click(function(e) {
var x=$(this).attr("data-x");
var y=$(this).attr("data-y");
var tit=$(this).attr("data-title")
map(x,y,tit);
});
}
var _li = $('.contact_index .txt li:eq(4)');
var _lix=_li.attr("data-x");
var _liy=_li.attr("data-y");
var _litit=_li.attr("data-title")
map(_lix,_liy,_litit);
// $('.contact_index .txt li:eq(4)').click(function() {
// map();
// });
$('#address1').click(function() {
if($(window).width() < 768) {
var url = $(this).data('address');
window.location = url;
}
});
$('#address2').click(function() {
if($(window).width() < 768) {
var url = $(this).data('address');
window.location = url;
}
});
/**
* js跳轉(zhuǎn)到指定指定元素位置
* @param ele 元素
* @param speed 速度
* @param offset 偏移量,優(yōu)化位置
*/
function scrollTo(ele, speed, offset) {
speed = speed || 300;
offset = offset || 0;
if (!ele) {
$("html,body").animate({
scrollTop: 0
}, speed);
} else {
$("html,body").animate({
scrollTop: ($(ele).offset().top - offset)
}, speed);
}
return false;
}
11
临武县|
康保县|
怀来县|
新龙县|
仪征市|
甘南县|
肃宁县|
益阳市|
岳西县|
沾化县|
台中县|
南通市|
柳林县|
霞浦县|
泊头市|
澳门|
仁怀市|
澄迈县|
巴青县|
浦县|
潞西市|
时尚|
博乐市|
滕州市|
潼南县|
绥滨县|
兴安盟|
吴堡县|
靖宇县|
宁南县|
宜君县|
南华县|
尼木县|
伽师县|
南部县|
罗田县|
西丰县|
时尚|
和田市|
墨竹工卡县|
潼关县|