[Users] Problem with PrintPreview ux and Proj4js

Thomas Colley it087 at neath-porttalbot.gov.uk
Tue Oct 23 16:37:43 CEST 2012


Thanks for replying

 

I had put the definition in but the error is the same. I have removed
all references to Proj4js from my code but just having the script
included causes the error.

 

Thanks

 

Tom

 

From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On
Behalf Of Michael Adair
Sent: 23 October 2012 14:58
To: users at geoext.org
Subject: Re: [Users] Problem with PrintPreview ux and Proj4js

 

Did you include the definition for EPSG:27700 somewhere in your code?




Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2
+k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36
+units=m +no_defs";


Mike

On 23/10/2012 8:08 AM, Thomas Colley wrote:

	Hi

	
	I have created an OpenLayers map with print functionality using
the GeoExt.ux.PrintPreview.

	 

	This was working fine until I added the proj4js script to the
page. Now clicking on the Print button gives me the following error

	 

	TypeError: p.proj is undefined

 

if (window.Proj4js && this.proj.defData && p.proj.defData) {

	 

	When I click on the Print button 'p' is coming back in Firebug
as the value 'EPSG:4326' instead of an OpenLayers.Projection object as
it does at all other times when viewing the map.

	 

	So the main problem is that something is passing projection
through as a value instead of an object so that projection.proj is
undefined, and a further problem is that the value is for the wrong EPSG
anyway as my map is all in ESPG:27700.

	 

	Is there somewhere else within the code that I need to define
the projection? It is correctly defined in the map and comes back as

	 

	EPSG:27700 { projCode="EPSG:27700", proj={...},
titleRegEx=RegExp, more...} 

	 

	in firebug.

	 

	I have edited the code in OpenLayers 'Projection.js' to make 'p
= new OpenLayers.Projection("EPSG:27700")' and with this change the
print preview window appears as it should.

	 

	Hope somebody can help as I am stuck on this.

	 

	Many thanks

	 

	Tom

	 

	 

	
	
	
	

	_______________________________________________
	Users mailing list
	Users at geoext.org
	http://www.geoext.org/cgi-bin/mailman/listinfo/users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20121023/fe1f392e/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 174 bytes
Desc: image001.png
Url : http://www.geoext.org/pipermail/users/attachments/20121023/fe1f392e/attachment-0001.png 


More information about the Users mailing list