gml lines in IExplorer

3 messages Options
Embed this post
Permalink
emmexx

gml lines in IExplorer

Reply Threaded More More options
Print post
Permalink
I'm having problems loading gml lines when using internet explorer (7).

I use the following code (excerpts):

vlayer = new OpenLayers.Layer.Vector("mylayer",
        {
                projection: map.displayProjection,
                                transitionEffect: 'resize'
        }
);

var inobj = new OpenLayers.Format.GML();
for (var key in phptrack)
{
        if (!isNaN(key))
        {
                y=inobj.read(URLDecode(phptrack[key].Segment.gpstrack));
                vlayer.addFeatures(y);
        }
}

The for loop reads a javascript variable, phptrack, that holds the lines
in gml format.
There are about 60 lines with 3300 vertices.
Firefox 3.5 loads the lines pretty fast, all the page loads in less then
10 seconds, google satellite map included.

In ie the page takes ages to load, at least 15 minutes, ie hangs with
the process running at 97% of cpu , the fan can be heard tens of meters
away from the laptop ;-)

I can't understand the big difference in the behaviour of ie and ff.
Even with less lines, 5 ie is so slow.

What can I do?

Thank you
        maxx



_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Johan_L

Re: gml lines in IExplorer

Reply Threaded More More options
Print post
Permalink
Adding a layer is very slow for me also in Internet Explorer, particularly the older IE:s (6 and 7). I'm loading a GeoJSON layer from file (stored locally) using a OpenLayers.Layer.Vector class. It's worth pointing out it is fast when adding the same file using a GML layer (i.e. not using layer.addFeatures(features) in the code). This is the essential part of my code:

{{{
var layer = new OpenLayers.Layer.Vector(t.name, {
                                                styleMap: styleMap, rendererOptions: {yOrdering: true}, format: OpenLayers.Format.GeoJSON});
                                       
                                        var onLoad = function(r) {
                                                var format = new OpenLayers.Format.GeoJSON();
                                                var features = format.read(r.responseText);
                                                if (popUpHeaders) {
                                                        for (var j=0, len=features.length; j<len; j++) {
                                                                features[j].attributes.popUpHeaders = popUpHeaders;
                                                        }
                                                }
                                                alert("start");
                                                layer.addFeatures(features);
                                                alert("end");
                                               
                                        };
                                        OpenLayers.loadURL(t.URL, {}, null, onLoad, function(r) {
                                                alert("kunde inte läsa in filen");
                                        });
}}}

emmexx wrote:
I'm having problems loading gml lines when using internet explorer (7).

I use the following code (excerpts):

vlayer = new OpenLayers.Layer.Vector("mylayer",
        {
                projection: map.displayProjection,
                                transitionEffect: 'resize'
        }
);

var inobj = new OpenLayers.Format.GML();
for (var key in phptrack)
{
        if (!isNaN(key))
        {
                y=inobj.read(URLDecode(phptrack[key].Segment.gpstrack));
                vlayer.addFeatures(y);
        }
}

The for loop reads a javascript variable, phptrack, that holds the lines
in gml format.
There are about 60 lines with 3300 vertices.
Firefox 3.5 loads the lines pretty fast, all the page loads in less then
10 seconds, google satellite map included.

In ie the page takes ages to load, at least 15 minutes, ie hangs with
the process running at 97% of cpu , the fan can be heard tens of meters
away from the laptop ;-)

I can't understand the big difference in the behaviour of ie and ff.
Even with less lines, 5 ie is so slow.

What can I do?

Thank you
        maxx



_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users
emmexx

Re: gml lines in IExplorer

Reply Threaded More More options
Print post
Permalink
In reply to this post by emmexx
Il 22/10/2009 19:34, emmexx scrisse:

> y=inobj.read(URLDecode(phptrack[key].Segment.gpstrack));
> vlayer.addFeatures(y);

Fyi, the problem is in that URLDecode function, non in openlayers.

bye
        maxx
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users