[OpenLayers-Dev] bug reported when adding postgis layer in chrome and firefox 4.0

Tim Schaub tschaub at opengeo.org
Fri Apr 22 12:36:20 EDT 2011


On 4/21/11 11:23 PM, Mohammed Rashad wrote:
> what are the problems when loading openlayers from single file?

I think we're having some miscommunication based on terms.

The OpenLayers.js loader [1] is a script that is meant for debug or 
development environments only.  It loads the entire library, one script 
at a time, uncompressed.  It should only be used when you need to debug 
(as it sounds like you do).

The version of this loader shipped with 2.10 does not work in Firefox 4. 
  This was addressed in r11036 [2] and the fix will be included in the 
2.11 release.  So, unless you are using the loader from the trunk after 
r11036, you should not expect it to work in Firefox 4.

In production, you want to build a concatenated and minified version of 
the library.  We call this the "single file" version of OpenLayers. 
When you build a single file version of OpenLayers, you include the 
SingleFile.js [3].  This sets OpenLayers.singleFile to true.

The "single file" OpenLayers always worked in Firefox 4.  So, in answer 
to your question, there are no problems (related to Firefox 4 
specifically) with the single file version.

The problem, again, is with the development/debug loader before r11036 
in Firefox 4 only.

If you need to debug a 2.10 release (or anything before r11036) in 
Firefox 4, then you'll need to patch your OpenLayers.js loader (with the 
change from r11036).

Hope that helps clarify,
Tim

[1] 
http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers.js

[2] 
http://trac.osgeo.org/openlayers/changeset/11036/trunk/openlayers/lib/OpenLayers.js

[3] 
http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers/SingleFile.js

> On Mon, Apr 18, 2011 at 8:41 PM, Mohammed Rashad
> <mohammedrashadkm at gmail.com <mailto:mohammedrashadkm at gmail.com>> wrote:
>
>
>
>     On Mon, Apr 18, 2011 at 8:17 PM, Tim Schaub wrote:
>
>         I'm guessing you are testing your application using the debug
>         loader. This is the OpenLayers.js file that loads all other
>         library files individually.  Versions of this loader from 2.10
>         and before do not work in Firefox 4.
>
>         You can use the latest from trunk to get a fix, or wait for the
>         2.11 release.
>
>         In any case, you should *never* put an application in production
>         using this OpenLayers.js loader.  This is strictly for
>         debugging/development purposes.
>
>     so I shoudn't use OpenLayers as a singleFile. But for me I need to
>     use it as singlefile because there is problem in loading the library
>     using require in Wt
>     reading a singlefile line by line help me to solve loading issue in
>     chrome and Firefox 4.0pre (Minifield)
>
>         Always use a minified build of the library.
>
>         http://docs.openlayers.org/library/deploying.html
>
>         Tim
>
>
>         On 4/18/11 6:13 AM, Mohammed Rashad wrote:
>
>
>             this is the chrome error
>             Uncaught TypeError: Cannot read property 'Vector' of undefined
>
>             Is this a bug in OL or chrome?
>             How to solve it?
>
>             the application works fine on Firefox 3.6.6 but not in firefox4
>
>             this is the code creating problem
>             new_layer = new OpenLayers.Layer.Vector("layername_", {
>                      strategies: [new OpenLayers.Strategy.BBOX(),
>             saveStrategy],
>                      projection: new OpenLayers.Projection("EPSG:4326"),
>                      protocol: new OpenLayers.Protocol.WFS({
>                          version: "1.0.0",
>                          srsName: "EPSG:4326",
>                          url: "http://localhost/cgi-bin/tinyows",
>                          featureNS : "http://www.tinyows.org/",
>                          featureType: layername_ ,
>                          geometryName: "the_geom",
>                          schema:
>             "http://localhost/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.0.0&typename=tows
>             <http://localhost/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.0.0&typename=tows>
>             <http://localhost/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.0.0&typename=tows
>             <http://localhost/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.0.0&typename=tows>>:"
>             + 'layername_'
>                      })});
>                    map.addLayer(new_layer);new_layer.refresh();
>
>             if this is commented out the it works but no output
>             --
>             Thanks && Regards
>             Rashad
>
>
>
>             _______________________________________________
>             Dev mailing list
>             Dev at lists.osgeo.org <mailto:Dev at lists.osgeo.org>
>             http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
>
>         --
>         Tim Schaub
>         OpenGeo - http://opengeo.org
>         Expert service straight from the developers.
>         _______________________________________________
>         Dev mailing list
>         Dev at lists.osgeo.org <mailto:Dev at lists.osgeo.org>
>         http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
>
>
>     --
>     Thanks && Regards
>     Rashad
>
>
>
>
> --
> Thanks && Regards
> Rashad


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.


More information about the Dev mailing list