[OpenLayers-Users] Permalink Not Working

chris1211 chris at powerhousetechgrp.com
Wed Apr 30 15:19:22 EDT 2008


I copyed the permalink code from the example but it is not working with my
map here is the code: Any help is appreciated (also if you could explain
where the problem is and why i would appreciate it)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WX Server</title>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
            #map {
                width: 100%;
                height: 400px;
                border: 1px solid black;
            }
            #wrapper {
                width: 1020px;
            }
        #nodelist {
	position:absolute;
	width:80%;
	height:115px;
	z-index:1;
	left: 123px;
	top: 497px;
	border: thin inset #0000FF;
	background-color: #666666;
	float: right;
	overflow: auto;
	visibility: hidden;
}
  #apDiv1 {
	position:absolute;
	left:210px;
	top:249px;
	width:391px;
	height:205px;
	z-index:2;
}
  #nodeList {
	position:absolute;
	width:923px;
	height:108px;
	z-index:1;
	left: 44px;
	top: 109px;
	background-color: #0000FF;
}
  #apDiv2 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
	left: 207px;
	top: 106px;
}
  #apDiv3 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
}
  #apDiv4 {
	position:absolute;
	width:443px;
	height:19px;
	z-index:2;
	background-color: #CCCCCC;
}
  #apDiv5 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:2;
	left: 156px;
	top: 280px;
}
  #apDiv6 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:2;
	left: 74px;
	top: 375px;
}
  #location {
	position:absolute;
	width:212px;
	height:15px;
	z-index:2;
	left: 336px;
	top: 95px;
	font-family: "Times New Roman", Times, serif;
	font-size: 12px;
	color: #CCCCCC;
	font-style: normal;
}
  #apDiv7 {
	position:absolute;
	width:624px;
	height:119px;
	z-index:2;
	left: 262px;
	top: 105px;
}
  #apDiv8 {
	position:absolute;
	width:572px;
	height:42px;
	z-index:2;
	left: 263px;
	top: 119px;
}
  .style1 {color: #000099}
  #apDiv9 {
	position:absolute;
	width:524px;
	height:135px;
	z-index:2;
	left: 291px;
	top: 207px;
	background-color: #666666;
	border: thin dotted #0033CC;
}
  </style>
        <script
src="http://192.168.1.192:8080/geoserver/openlayers/OpenLayers.js"
type="text/javascript">
        </script>
<script src="SpryAssets/SpryMenuBar.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;
       
        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
            base = new OpenLayers.Layer.WMS(
                "BASE GIS", "http://192.168.1.192/geoserver/wms",
                {
                    width: '1020',
                    layers:
'topp:ncounties,topp:PAH_N0R_0,topp:henryco,PAH,topp:torpoly,topp:svrpoly',
                    styles: '',
                    srs: 'EPSG:4326',
                    height: '400',
                    format: 'image/png',
                    tiled: 'true',
                      },
                {buffer: 0} 
            );
           
            map.addLayers([base]);
           
		   
		        
            // setup controls and initial zooms
         //map.addControl(new OpenLayers.Control.ArgParser ());
			map.addControl(new OpenLayers.Control.PanZoomBar());
            map.addControl(new OpenLayers.Control.Navigation());
	        map.addControl(new OpenLayers.Control.Permalink());
			map.addControl(new OpenLayers.Control.Permalink('permalink'));
		//	map.setCenter(new OpenLayers.LonLat(-88.33,36.3),5);
            
			  // support GetFeatureInfo
             if (!map.getCenter()) map.zoomToMaxExtent();
			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: 'PAH,topp:henryco,torpoly,svrpoly',
                        FEATURE_COUNT: 20,
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h
                    },
                    "http://192.168.1.192/geoserver/wms"
                );
                OpenLayers.loadURL(url, '', this, setHTML, setHTML);
                OpenLayers.Event.stop(e);
            });
        }
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById &&
((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
</script>
        <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet"
type="text/css" />
        <style type="text/css">
<!--
.style4 {
	color: #FF0000;
	font-weight: bold;
}
-->
        </style>
</head>
<body onload="init()">
<!-- start header -->
<div id="header">
 
 
  <div id="apDiv9">Quick Locations:
    <ul id="MenuBar1" class="MenuBarHorizontal">
          <li> # City of Paris               </li>

      <li> # Henry, TN </li>
      <li> # Puryear, TN         </li>
      <li> # Paris Landing </li>
      <li> # Close Menu </li>
    </ul>
    <div align="" class="box2">

      <p>&nbsp;</p>
      <p class="style4">Note: The Storm Tracks and Storm Cell Information is
Expermental at this time! Threre may be error's in the Tracks or Cell
Information.    </p>
    </div>
  </div>
  <div id="logo">
	<h1> # WXserver<sup></sup> </h1>
	  <h2>Designed by Chris Brisendine</h2>

  </div>
  <div id="menu">
		<ul>
		  <li class="active"> #  Nexrad </li>
		  <li onmouseover="MM_showHideLayers('Accordion1','','hide')"> # Severe
Weather 	      </li>
		    <li> # Flood &amp; Precip </li>

			<li> # Hide Info Box. </li>
			<li> # Show Info Box. </li>
		</ul>
  </div>
</div>
<!-- end header --> <div class="style1" id="map"></div>
<!-- start page -->

<div id="footer">
  
  <p id="legal">||Designed By:Chris Brisendine || Powered by: CENTOS,
Apache, PostGIS,Geoserver and Openlayers.|| Copyright 2008 Chris
Brisendine</p>

  <div id="nodelist"></div>
  <p>&nbsp;</p> 
</div>
<!-- end footer -->

<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1",
{imgDown:"SpryAssets/SpryMenuBarDownHover.gif",
imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>

-- 
View this message in context: http://www.nabble.com/Permalink-Not-Working-tp16989744p16989744.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list