'graphic' may mean something different, like SVG graphic). Tests, docs, example, and library change. Thanks, Tim! git-svn-id: http://svn.openlayers.org/trunk/openlayers@1712 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
52 lines
1.8 KiB
HTML
52 lines
1.8 KiB
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<style type="text/css">
|
|
p {
|
|
width: 512px;
|
|
}
|
|
#map {
|
|
width: 512px;
|
|
height: 256px;
|
|
border: 1px solid gray;
|
|
}
|
|
</style>
|
|
<script src="../lib/OpenLayers.js"></script>
|
|
<script type="text/javascript">
|
|
<!--
|
|
function init(){
|
|
var map = new OpenLayers.Map('map');
|
|
|
|
var options = {maxResolution: 'auto', numZoomLevels: 3};
|
|
|
|
var graphic = new OpenLayers.Layer.Image(
|
|
'City Lights',
|
|
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
|
|
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
|
new OpenLayers.Size(580, 288),
|
|
options);
|
|
|
|
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
|
"http://wms.jpl.nasa.gov/wms.cgi",
|
|
{layers: "modis,global_mosaic"}, options);
|
|
|
|
map.addLayers([graphic, jpl_wms]);
|
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
|
map.zoomToMaxExtent();
|
|
}
|
|
// -->
|
|
</script>
|
|
</head>
|
|
<body onload="init()">
|
|
<h1>OpenLayers Image Layer Example</h1>
|
|
<div id="map"></div>
|
|
<p>
|
|
The "City Lights" layer above is created from a single web accessible
|
|
image. If you construct it without any resolution related options,
|
|
the layer will be given a single resolution based on the extent/size.
|
|
Otherwise, it behaves much like a regular layer. This is primarily
|
|
intended to be used in an overview map - where another layer type
|
|
might not make a good overview.
|
|
</p>
|
|
</body>
|
|
</html>
|