[OpenLayers-Users] Permalink Help
brizey02
ki4gyw at gmail.com
Sat Aug 2 02:45:23 EDT 2008
Can someone please help me add the permalink function and get it working here
is my working code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="refresh"
content="600;URL=http://ema.henrycountytn.org/ema.htm" />
<title>Henry County EMA - GIS / Nexrad Viewer by:Chris
Brisendine</title>
<style type="text/css">
#map {
width: 800px;
height: 317px;
border: 1px solid black;
top: 150px;
}
#wrapper {
width: 800px;
}
#location {
float: right;
}
#apDiv1 {
position:absolute;
width:169px;
height:21px;
z-index:1;
left: 818px;
top: 15px;
}
.style1 {color: #FF0000}
.style2 {
color: #0099CC;
font-weight: bold;
}
</style>
<script
src="http://ema.henrycountytn.org/geoserver/openlayers/OpenLayers.js"
type="text/javascript">
</script>
<script defer="defer" type="text/javascript">
var map;
var untiled;
var tiled;
function setHTML(response) {
document.getElementById('nodelist').innerHTML =
response.responseText;
};
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
OpenLayers.DOTS_PER_INCH = 25.4 / 0.28;
function init(){
var bounds = new OpenLayers.Bounds(
-127.61950111389118, 23.735178565979016,
-64.08176994323732, 50.59252300262448
);
var options = {
controls: [],
maxExtent: bounds,
maxResolution: 0.24819426238536663,
projection: "EPSG:4326",
units: 'degrees'
};
map = new OpenLayers.Map('map', options);
// setup tiled layer
tiled = new OpenLayers.Layer.WMS(
"Geoserver layers - Tiled",
"http://ema.henrycountytn.org/geoserver/wms",
{
height: '317',
width: '800',
layers:
'topp:uscounty,topp:NQA_N0R_0,nstreets,svrpoly,torpoly',
styles: '',
srs: 'EPSG:4326',
format: 'image/png',
tiled: 'true',
tilesOrigin : "-127.61950111389118,23.735178565979016"
},
{buffer: 0}
);
// setup single tiled layer
untiled = new OpenLayers.Layer.WMS(
"Geoserver layers - Untiled",
"http://ema.henrycountytn.org/geoserver/wms",
{
height: '317',
width: '800',
layers:
'topp:uscounty,topp:NQA_N0R_0,nstreets,henryco,svrpoly,torpoly',
styles: '',
srs: 'EPSG:4326',
format: 'image/png'
},
{singleTile: true, ratio: 1}
);
map.addLayers([tiled]);
// setup controls and initial zooms
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.LayerSwitcher());
//map.addControl(new OpenLayers.Control.OverviewMap());
// map.zoomToExtent(bounds);
map.setCenter(new OpenLayers.LonLat(-88.81, 35.61), 7);
// support GetFeatureInfo
map.events.register('click', map, function (e) {
document.getElementById('nodelist').innerHTML = "Loading...
please wait...";
var url = map.layers[0].getFullRequestString(
{
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "application/vnd.ogc.se_xml",
BBOX: map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html',
QUERY_LAYERS:
'topp:uscounty,nstreets,svrpoly,torpoly',
FEATURE_COUNT: 50,
WIDTH: map.size.w,
HEIGHT: map.size.h
},
"http://ema.henrycountytn.org/geoserver/wms"
);
OpenLayers.loadURL(url, '', this, setHTML, setHTML);
OpenLayers.Event.stop(e);
});
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
</head>
<body onload="init()">
<div id="apDiv1"
onclick="MM_openBrWindow('http://mozilla.org','','toolbar=yes,location=yes,status=yes,menubar=yes')">
<p>Built by: mailto:ki4gyw at gmail.com Chris Brisendine | This
product is currently in BETA | Works Best with the Firefox web browser, If
the Images Fail to Load Click the Reload Button on your web browser, this is
caused by the refreshing of radar data. Also this product takes some time to
load images due to bandwidth. this application upated every 6 minutes.</p>
<p> </p>
</div>
<div id="map"></div>
<div id="wrapper"></div>
<div id="nodelist">Feature info - Click on the map to view</div>
</body>
</html>
--
View this message in context: http://www.nabble.com/Permalink-Help-tp18786525p18786525.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list