<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<style>
map {
width: 100%;
position: fixed;
top: 0px;
bottom: 0px;
line-height: 200px;
text-align: center;
background: #FFFFFF;
}
</style>
<script type="text/javascript" charset="utf-8">
let map = null;
mui.init();
mui.plusReady(function() {
map = new plus.maps.Map('map');
map.showUserLocation(true);
// map.getUserLocation(function(state, point) {
// if(0 == state) {
// createMarker(point);
// }
// });
plus.geolocation.getCurrentPosition(function(p) {
let point = new plus.maps.Point(p.coords.longitude, p.coords.latitude);
createMarker(point);
map.centerAndZoom(point, 19);
}, function(e) {}, {provider: "baidu"});
});
function createMarker(point) {
let marker=new plus.maps.Marker(point);
marker.setIcon("marker.png");
map.addOverlay(marker);
console.log(point.getLng() + ',' + point.getLat());
}
</script>
</head>
<body>
<div id="map">地图加载...</div>
</body>
</html>
2 个回复
prettydog
请教一下,我用的vue-cli...打包成ios。怎么存储一下基本信息。sessionStorage使用这个无效
JoBoJun
请问,这个问题解决了吗?