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)建檢索信息窗口對(duì)象
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對(duì)象
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
荥经县|
连平县|
长子县|
乌审旗|
怀远县|
昔阳县|
临城县|
仙居县|
河池市|
固安县|
都江堰市|
乌兰县|
唐海县|
定州市|
合山市|
东源县|
保山市|
屯门区|
柯坪县|
宜兰市|
随州市|
巴彦淖尔市|
花莲县|
黄骅市|
秦安县|
东台市|
剑河县|
义马市|
楚雄市|
宁南县|
尖扎县|
元朗区|
霍城县|
前郭尔|
车险|
米易县|
临江市|
正宁县|
治县。|
盐池县|
手游|