<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OverlayLayer</title>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
background: #fff;
}
#map {
position: relative;
height: 1020px;
border: 1px solid #3473b7;
}
#toolbar {
position: relative;
height: 33px;
padding-top: 5px;
}
</style>
<link href='css/bootstrap.min.css' rel='stylesheet' />
<link href='css/bootstrap-responsive.min.css' rel='stylesheet' />
<script src='libs/SuperMap.Include.js'></script>
<script type="text/javascript">
var map, layerWorld, layerJingjing;
var url = "http://10.1.30.49:8090/iserver/services/map-JSGISTMongoDB/rest/maps/JSGIST-DZH";
var url2 = "http://10.1.30.49:8090/iserver/services/map-WS_JSJT/rest/maps/GLCRK";
function init() {
map = new SuperMap.Map("map", {
controls : [ new SuperMap.Control.LayerSwitcher(),
new SuperMap.Control.ScaleLine(),
new SuperMap.Control.OverviewMap(),
new SuperMap.Control.Zoom(),
new SuperMap.Control.Navigation({
dragPanOptions : {
enableKinetic : true
}
}) ],
allOverlays : true
});
layerWorld = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
transparent : true,
cacheEnabled : true
});
layerWorld.events.on({
"layerInitialized" : addLayer1
});
}
function addLayer1() {
layerJingjing = new SuperMap.Layer.TiledDynamicRESTLayer("京津地区地图",
url2, {
transparent : true,
cacheEnabled : true
});
layerJingjing.events.on({
"layerInitialized" : addLayer2
});
//layerJingjing.setOpacity(0.6);
}
function addLayer2() {
map.addLayers([ layerWorld, layerJingjing ]);
map.setCenter(new SuperMap.LonLat(118, 40), 6);
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OverlayLayer</title>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
background: #fff;
}
#map {
position: relative;
height: 1020px;
border: 1px solid #3473b7;
}
#toolbar {
position: relative;
height: 33px;
padding-top: 5px;
}
</style>
<link href='css/bootstrap.min.css' rel='stylesheet' />
<link href='css/bootstrap-responsive.min.css' rel='stylesheet' />
<script src='libs/SuperMap.Include.js'></script>
<script type="text/javascript">
var map, layerWorld, layerJingjing;
var url = "http://10.1.30.49:8090/iserver/services/map-JSGISTMongoDB/rest/maps/JSGIST-DZH";
var url2 = "http://10.1.30.49:8090/iserver/services/map-WS_JSJT/rest/maps/GLCRK";
function init() {
map = new SuperMap.Map("map", {
controls : [ new SuperMap.Control.LayerSwitcher(),
new SuperMap.Control.ScaleLine(),
new SuperMap.Control.OverviewMap(),
new SuperMap.Control.Zoom(),
new SuperMap.Control.Navigation({
dragPanOptions : {
enableKinetic : true
}
}) ],
allOverlays : true
});
layerWorld = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
transparent : true,
cacheEnabled : true
});
layerWorld.events.on({
"layerInitialized" : addLayer1
});
}
function addLayer1() {
layerJingjing = new SuperMap.Layer.TiledDynamicRESTLayer("京津地区地图",
url2, {
transparent : true,
cacheEnabled : true
});
layerJingjing.events.on({
"layerInitialized" : addLayer2
});
//layerJingjing.setOpacity(0.6);
}
function addLayer2() {
map.addLayers([ layerWorld, layerJingjing ]);
map.setCenter(new SuperMap.LonLat(118, 40), 6);
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>