[OpenLayers-Users] Proj4 and displayProjection?

Mike Adair madair at dmsolutions.ca
Thu Jun 10 13:45:53 EDT 2010


Zoran,

It looks like you are using Proj4js where it dynamically loads the 
required projection code files.  In some earlier versions of Proj4js 
that had problems in IE (possibly in Chrome as well) but I think that is 
fixed in the latest version.  In any case, you can get around the issue 
by using proj4js-compressed.js rather than proj4js.js which includes all 
projection code.  You can also build your own version of 
Proj4js-compressed with only the projections you need and it would save 
a little space.

Mike



Zoran Jankovic wrote:
> Hi list,
>
> I'm sort of a newbie, and I have a question regarding the usage of 
> Proj4.js, defining displayProjection and various browser 
> interpretation. In short, everything works as intended when using 
> latest Firefox, but it seems that my custom displayProjection is not 
> recognized when using Chrome or IE8.
>
> I have defined both SphericalMercator and my custom projection using 
> Proj4js.defs. I do not not for sure that this is necessary, but I have 
> found that retrieving selected data via WFS displays as I want only 
> using this setup, and only using Firefox. So FF displays data correctl 
> on the first load, you can choose Street name and click on "Display" 
> button, and voila, the map zooms to the streets BBOX. IE8 and Chrome 
> show initial ma extent somewhere in Turkmenistan, bounds are not 
> transformed/projected correctly and you can only see GMaps, not my 
> data that is several thousand km west :-).
>
> My problem is, if I have to point it out by now, that I really need to 
> make it work at least with IE8 :-(.
>
> Perhaps it is best that you should look at the example. The site is 
> not live, so I set up a little port forwarding... Please, do not abuse 
> :-). The site is in Croatian, yes I know the encoding is screwed, but 
> this is all ad hoc, just to solve this projection problem.
> It is intended to be used for searching street names, and later on for 
> addresses as well, maybe we'll add some POI with pictures (pop up), 
> etc. If anyone has experience with this sort of things, I would very 
> much appreciate all the help, tips and/or links.
>
> http://89.164.44.84/geoserver/kutina/pretrazivanje_po_ulicama_vanjski_4.html
>
> The link will be live for a couple of hours... Try it with FF, and 
> then with Chrome or IE8 and you'll see what my problem is :-(.
>
> ---
> Zoran Jankovic
> ZIS-Izrada softvera i savjetovanje / ZIS - Software Development and 
> Consulting
>
> http://www.zisis.hr
>
> M: 00 385 98 682 902
> T:  00 385 44 683 374
>
> A. Senoe 4
> 44320 Kutina
> Croatia
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   

-- 
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   madair at dmsolutions.ca
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca





More information about the Users mailing list