先把JDK安装好;
tomcat分为安装版,解压版;通常使用解压版;解压后目录结构如图;
启动tomcat的方式:进入bin目录,双击批处理文件startup;
启动好以后桌面会出现控制台;
查看如图网址,出现tomcat的猫的起始页面;表明tomcat运行正常,JDK已经安装好;
新建一个jsp,实现加载超图地图的基本功能,效果如图;
1.jsp的位置如图;
超图库文件的位置如图;
1.jsp;
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>supermap demo1</title>
<link href='<%=path%>/script/libs/css/bootstrap.min.css' rel='stylesheet' />
<link href='<%=path%>/script/libs/css/bootstrap-responsive.min.css' rel='stylesheet' />
<script src='<%=path%>/supermapDemo/script/supermap/libs/SuperMap.Include.js'></script>
<style type="text/css">
body{
margin: 0;
overflow: hidden;
background: #fff;
}
#map{
position: relative;
height: 500px;
width:800px;
border:1px solid #3473b7;
}
</style>
</head>
<body onload="init()">
<p>
today is : <%= (new java.util.Date()).toLocaleString()%>
</p>
<div id="map"></div>
</body>
<script type="text/javascript">
var map,layer,
// url="http://ip:8080/Map/181b9990-xxxx-a056-db14d1327af2/fqImage";
// url="http://ip:8080/Map/181b9990-xxxx-a056-db14d1327af2/fqImgLabel";
url="http://ip:8080/Map/181b9990-xxxx-a056-db14d1327af2/fqVector";
urlfqvec="http://maps.xxmap.cn/Map/181b9990-xxxx-a056-db14d1327af2/fqVector";
urlfqdz="http://maps.xxmap.cn/Map/181b9990-xxxx-a056-db14d1327af2/fqImage";
//边界
// var bounds = new SuperMap.Bounds(xx.52 , xx.22,xxx.23 , xx.04 );//影像
// var bounds = new SuperMap.Bounds(xx.28 , xx.22,xxx.5 , xx.48 );//注记
var bounds = new SuperMap.Bounds(xx.28 , xx.22,xxx.5 , xx.48 );//电子地图
function init(){
map = new SuperMap.Map("map",{controls:[
new SuperMap.Control.Navigation() ,
new SuperMap.Control.Zoom()]});
layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", urlfqvec, {transparent: true,
cacheEnabled: true},
{ dpi:95.99999999999939,
maxExtent:bounds,
// resolutions:[0.001,0.0005,0.0002,0.0001,0.00005,0.00002,0.00001,0.000005,0.000002,0.000001,0.0000005,0.0000002,0.0000001 ]
resolutions:[0.001,0.0005,0.0002,0.0001,0.00005,0.00002,0.00001,0.000005,0.000002,0.000001,0.0000005,0.0000002,0.0000001 ]
});
map.addLayer(layer);
map.setCenter(new SuperMap.LonLat(xx.87 , xx.87), 2);//影像
// map.setCenter(new SuperMap.LonLat(xxx.01 , xx.8), 3);//影像注记
// map.setCenter(new SuperMap.LonLat(xx.92756 , xx.58345), 4);//电子地图
}
</script>
</html>