function checkhHtml5() {
if (typeof(Worker) === "undefined") {
if(navigator.userAgent.indexOf("MSIE 9.0")<=0) {
alert("请使用: chrome、firefox、safari、IE10 浏览器");
}
}
}
checkhHtml5();
var bdMap;
// 初始化地图
function initBdMap () {
bdMap = new BMap.Map('mapContainer');
// 设置中心点
if(curCityInfo.lng && curCityInfo.lat){
var point = new BMap.Point(curCityInfo.lng, curCityInfo.lat);
bdMap.centerAndZoom(point, curCityInfo.zoom || 10);
}
else{
// 创建地址解析器实例
var myGeo = new BMap.Geocoder();
// 将地址解析结果显示在地图上,并调整地图视野
var address = curCityInfo.name;
myGeo.getPoint(address, function (point) {
if (point) {
bdMap.centerAndZoom(point, curCityInfo.zoom || 10);
} else {
alert("您选择地址没有解析到结果!");
}
}, address);
}
bdMap.enableScrollWheelZoom(true);
// 设置地图风格
var mapStyle ={
features: ["road", "building","water","land"],//隐藏地图上的poi
style : "midnight"
};
bdMap.setMapStyle(mapStyle);
bdMap.clearOverlays();
// 初始化宠物医院数据
localStorage.getItem('isShowHospital') && initHospital();
// 初始化宠物数据
localStorage.getItem('isShowPets') && initPets();
}
// 宠物医院
function initHospital() {
let length = hospitalData.length;
if (length == 0) {
return;
}
var config = {
icon: compbase + '/icon/hospital.png',
iconWidth: 32,
iconHeight: 32,
};
for(var i=0; i