var ws = null,
wo = null;
var em = null,
map = null,
pcenter = null;
var webview_info = null; //机构信息webview
// H5 plus事件处理
function plusReady() {
// if(!em || ws) {
// return
// };
//获取窗口对象
ws=plus.webview.currentWebview();
pcenter = new plus.maps.Point(116.404 , 39.901);
setTimeout(function() {
map = new plus.maps.Map("map");
map.centerAndZoom(pcenter, 12);
createMarker();
// 创建子窗口
createSubview();
}, 300);
//预加载页面
loadPage();
}
if(window.plus) {
plusReady();
} else {
document.addEventListener("plusready", plusReady, false);
}
// DOMContentloaded事件处理
document.addEventListener("DOMContentLoaded", function() {
em = document.getElementById("map");
window.plus && plusReady();
}, false);
function createMarker() {
var marker = new plus.maps.Marker(new plus.maps.Point(116.304881,39.965527));
// marker.setMapType(new plus.maps.MapType.MAPTYPE_SATELLITE);//地图类型:普通地图图
marker.setIcon("../../blue.png");
marker.setLabel("区委办");
var bubble = new plus.maps.Bubble("区委办");
marker.setBubble(bubble);
map.addOverlay(marker);
}
function createSubview(){
// 创建加载内容窗口
var topoffset='44px';
var wsub=plus.webview.create('maps_map_sub.html','sub',{height:'60px',position:'absolute',scrollIndicator:'none',background:'transparent', bottom: '0'});
ws.append(wsub);
}