[Users] Problem with PrintPreview ux and Proj4js

Michael Adair madair at dmsolutions.ca
Tue Oct 23 15:57:52 CEST 2012


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
>
> Description: chrome://firebug/content/blank.gif
>
> 	
>
> 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/2938d089/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 174 bytes
Desc: not available
Url : http://www.geoext.org/pipermail/users/attachments/20121023/2938d089/attachment.png 


More information about the Users mailing list