[OpenLayers-Users] Uncaught TypeError: Cannot read property 'x' of
null - popup problem
Robert Buckley
robertdbuckley at yahoo.com
Wed Aug 10 13:24:30 EDT 2011
Hi,
I´ve just added a simple wms popup to a map which has worked in the past and now
I get the error
"Uncaught TypeError: Cannot read property 'x' of null"
Anyone any idea how to solve this?
yours,
Rob
// create the popup
var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
queryVisible: true,
highlightOnly: true,
maxFeatures: 5,
maxFeatures: 1
});
featureInfo.events.on({
getfeatureinfo: function(e) {
new GeoExt.Popup({
title: "<b><h2>Position:
</h2></b>"+mapPanel.map.getLonLatFromPixel(e.xy).transform(epsg900913,
epsg4326),
width: 400,
autoHeight: true,
layout: 'accordion',
bodyStyle: 'background-color:#FFF;,font-size:14px;',
autoScroll: true,
maximizable: true,
map: map,
lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
html:e.text,
unpinnable:true,
anchored: true,
shadow: true,
listeners: {
close: function() {
// closing a popup destroys it, but our reference is
truthy
popup = null;
}
}
}).show();
}
});
map.addControl(featureInfo);
featureInfo.activate();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110810/9270b1e2/attachment.html
More information about the Users
mailing list