tomcat基本使用和超图基本jsp例子

149 篇文章 2 订阅

先把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> 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值