You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
55 lines
1.7 KiB
|
2 years ago
|
<!DOCTYPE html>
|
||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8" />
|
||
|
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
|
||
|
|
<title></title>
|
||
|
|
<style>
|
||
|
|
*{
|
||
|
|
margin:0;
|
||
|
|
padding:0;
|
||
|
|
}
|
||
|
|
html,body{
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
overflow: hidden;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
<link type="text/css" href="jsmap/jsmap_base.css" rel="stylesheet"/>
|
||
|
|
<script type="text/javascript" src="jsmap/jsmap_base.js"></script>
|
||
|
|
<script type="text/javascript" src="https://unpkg.com/@dcloudio/uni-webview-js@0.0.3/index.js"></script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div id="app" style="width: 100vw;height: 100vh;"></div>
|
||
|
|
<script>
|
||
|
|
var map = new jsmapbase.JSMap({
|
||
|
|
container:'app',
|
||
|
|
mapServerURL:'http://192.168.3.109:89/data/map/0001/default/bundle.pbf',
|
||
|
|
backgroundColor:'#FF0'
|
||
|
|
});
|
||
|
|
map.openMapById('0001');
|
||
|
|
map.on("loadComplete", e => {
|
||
|
|
var floorControl = new jsmapbase.JSFloorControl({
|
||
|
|
position: jsmapbase.JSControlPosition.RIGHT_TOP,//控件在容器中的位置
|
||
|
|
showBtnCount: 3,//默认显示楼层的个数 TODO
|
||
|
|
allLayers: false, //初始是否是多层显示,默认单层显示
|
||
|
|
needAllLayerBtn: true, // 是否显示多层/单层切换按钮
|
||
|
|
offset: {
|
||
|
|
x: 20,
|
||
|
|
y: 10
|
||
|
|
}//位置x,y的偏移量
|
||
|
|
});
|
||
|
|
map.addControl(floorControl);
|
||
|
|
});
|
||
|
|
map.on('mapClickNode', event => {
|
||
|
|
console.log('===========',JSON.stringify(event));
|
||
|
|
uni.postMessage({
|
||
|
|
data: {
|
||
|
|
detail: event
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|