1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: chenlingfeng7543
$Date: 2018/6/26 11:15
$Revision: 1.0
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view template="default" package="leaf.ui.std">
<style type="text/css"><![CDATA[
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
]]></style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=KMBR5EAyR6x0YV9DG8YYaKQWVuv2AyNh"></script>
<div id="allmap" style="width: 100%;height:100%;overflow: hidden;margin:0;font-family:'微软雅黑'"></div>
<script ><![CDATA[
// 百度地图API功能
var map = new BMap.Map("allmap");
var longitude = '${/parameter/@longitude}';//经度
var latitude= '${/parameter/@latitude}';//纬度
if (latitude &&longitude){
var point = new BMap.Point(longitude, latitude);
map.centerAndZoom(point, 15);
var marker = new BMap.Marker(point); // 创建标注
map.addOverlay(marker); // 将标注添加到地图中
//marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
var top_left_control = new BMap.ScaleControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}); // 左上角,添加比例尺
var top_left_navigation = new BMap.NavigationControl(); //左上角,添加默认缩放平移控件
//var top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL});
map.addControl(top_left_control);
map.addControl(top_left_navigation);
map.addControl(new BMap.MapTypeControl());
map.enableScrollWheelZoom(); //启用滚轮放大缩小
// map.setDefaultCursor("crosshair");//修改鼠标样式
}
]]></script>
</a:view>
</a:screen>