[OpenLayers-Users] IE 8 this.size.w is null or not an object - OL 2.9

Dash jimlug at co.clackamas.or.us
Thu May 6 15:39:35 EDT 2010


Hello again,

I was excited to hear there was a fix but when I downloaded and tried 2.9.1
I still received the same error message within Internet Explorer when I
click on a point and try to obtain the popup box:

"this.size.w" is null or not an object.

I am totally at a loss .  I've attached some of my code in hopes that
someone will be able to point out the issue (if there is one).

function findLayerClick(event) {
	
	mouseLoc = map.getLonLatFromPixel(event.xy);
	
	var url = prox.getFullRequestString({
		REQUEST: "GetFeatureInfo",
		EXCEPTIONS: "application/vnd.ogc.se_xml",
		BBOX: map.getExtent().toBBOX(),
		X: event.xy.x,
		Y: event.xy.y,
		INFO_FORMAT: 'gml',
		LAYERS: map.layers[6].params.LAYERS + "," + map.layers[7].params.LAYERS,
		QUERY_LAYERS: map.layers[6].params.LAYERS + "," +
map.layers[7].params.LAYERS,
		FEATURE_COUNT: 1,
		WIDTH: map.size.w,
		HEIGHT: map.size.h,
		STYLE: ''},
		"http://ain'tnothinglikeachickenwing?");
	
	OpenLayers.loadURL(url, '', this, setHTML);
	Event.stop(event);
}

function setHTML(response) {
  var xmlFormat = new OpenLayers.Format.XML();
  var xmlResponse = xmlFormat.read(response.responseText);
  var featureType = xmlResponse.getElementsByTagName("feature")[0];
  var lyrName = featureType.textContent;

  switch(lyrName)
	{
		case "adt":
			//alert("Layer name: " + lyrName);
			var adt1995 = xmlResponse.getElementsByTagName("adt1995")[0];
			var value1995 = adt1995.textContent;
			var adt1997 = xmlResponse.getElementsByTagName("adt1997")[0];
			var value1997 = adt1997.textContent;
			var adt2000 = xmlResponse.getElementsByTagName("adt2000")[0];
			var value2000 = adt2000.textContent;
			var adt2002 = xmlResponse.getElementsByTagName("adt2002")[0];
			var value2002 = adt2002.textContent;
			var adt2005 = xmlResponse.getElementsByTagName("adt2005")[0];
			var value2005 = adt2005.textContent;
			var adt2008 = xmlResponse.getElementsByTagName("adt2008")[0];
			var value2008 = adt2008.textContent;
			// Create popup box
			var popup_info = "Average Daily Traffic Counts<br />" +
					"ADT 1995: " + value1995 + "<br />" + 
					"ADT 1997: " + value1997 + "<br />" + 
					"ADT 2000: " + value2000 + "<br />" +
					"ADT 2002: " + value2002 + "<br />" +
					"ADT 2005: " + value2005 + "<br />" +
					"ADT 2008: " + value2008 + "";
			break;
		case "turnmove":
			//alert("Layer name: " + lyrName);
			var interSecTag = xmlResponse.getElementsByTagName("addr")[0];
			var intersection = interSecTag.textContent;
			var pdfLinkTag = xmlResponse.getElementsByTagName("link")[0];
			var pdfLink = pdfLinkTag.textContent;
			var popup_info = "Turning Movement<br />" + 
					"Intersection: " + intersection + "<br />" + 
					"PDF Image:   + pdfLink +  Total Vehicle Summary ";
			break;
		defualt:
			alert("No layer selected.");
	}

if (popup != null) {
    	popup.destroy();
      popup = null;
    }

	popup = new OpenLayers.Popup.FramedCloud("Traffic",
		mouseLoc,
		new OpenLayers.Size(250,120),
		popup_info,
		null,
		true);

map.addPopup(popup);
  popup.events.register("click", map, popupDestroy);
}
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/IE-8-this-size-w-is-null-or-not-an-object-OL-2-9-tp5006221p5016099.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list