[OpenLayers-Users] tilesOrigin distorts feature info on zoom
brizey02
ki4gyw at gmail.com
Thu Dec 11 03:41:53 EST 2008
tilesOrigin causes feature info to be off once i zoom in past 1:72k, what is
causing this?
I removed this witch makes the map work perfectly in firefox but ie does not
load the page.
is there any way to fix this? my bbox's are set to different for each
feature should i set
all the features the same?
Here is the pagecode any help would be greatly appreciated....
<?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>
<title>OpenLayers map preview</title>
<style type="text/css">
#map {
width: 550px;
height: 350px;
border: 1px solid black;
}
#wrapper {
width: 550px;
}
#location {
float: right;
}
</style>
<script
src="http://www.gis.net:8080/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(
-91.74701843261714, 34.3409034729004,
-85.79698791503903, 39.795098114013676
);
var options = {
controls: [],
maxExtent: bounds,
maxResolution: 0.023242306709289506,
projection: "EPSG:4326",
units: 'degrees'
};
map = new OpenLayers.Map('map', options);
// setup tiled layer
tiled = new OpenLayers.Layer.WMS(
"Geoserver layers - Tiled",
"http://www.gis.net:8080/geoserver/wms",
{
height: '350',
width: '550',
layers: 'states,topp:pahcomp,uscounty,henryco',
styles: '',
srs: 'EPSG:4326',
format: 'image/png',
tiled: 'true',
tilesOrigin : "-91.74701843261714,34.3409034729004"
},
{buffer: 0}
);
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.Scale($('scale')));
map.addControl(new OpenLayers.Control.MousePosition({element:
$('location')}));
map.addControl(new OpenLayers.Control.LayerSwitcher());
//map.addControl(new OpenLayers.Control.OverviewMap());
map.zoomToExtent(bounds);
// 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: map.layers[0].params.LAYERS,
FEATURE_COUNT: 50,
WIDTH: map.size.w,
HEIGHT: map.size.h
},
"http://www.gis.net:8080/geoserver/wms"
);
OpenLayers.loadURL(url, '', this, setHTML, setHTML);
OpenLayers.Event.stop(e);
});
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
<div id="wrapper">
<div id="location"></div>
<div id="scale"></div>
</div>
<div id="nodelist">Click on the map to get feature info</div>
</body>
</html>
--
View this message in context: http://www.nabble.com/tilesOrigin-distorts-feature-info-on-zoom-tp20951557p20951557.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list