[OpenLayers-Dev] Grid Strategy - feedback and few questions

Eric Lemoine eric.c2c at gmail.com
Thu Feb 26 07:26:46 EST 2009


On Mon, Feb 23, 2009 at 12:14 PM, Ivan Grcic <ivan.grcic at geofoto.hr> wrote:
> Hi all,
>
> well i guess this primarly goes to Eric but anyone can jump in :)
>
> Ive just tried gridStrategy from vector-behavior
> http://dev.openlayers.org/sandbox/vector-behavior/ and im pretty happy
> how it works.
> So i just want to drop few lines while impressions are still fresh. i
> know its still in develop. so maybe thats the answear to some of my
> questions ;)
>
> First improvment one can see beetwen strategies Grid & BBOX is the
> similar one to WMS & WMS.Untiled. When you drag the map, features dont
> dissapear but only new ones load. Very very nice!

You got the concept ;-)


> But when you observe XHR traffic, there are much more requests, cuz it
> splits big request to 256x256 tiled requests. First thing i did is to
> set option tileSize: new OpenLayers.Size(512,512) and I got satisfing
> number of 4-8 request per map move. As i used only points features i
> put options safe: false.

We could make 512x512 if you think that makes more sense.

> 1)First question, setting tile size different then map is perfectly
> ok, right? Doesnt affect anythign else then Grid strategy?

It affects the grid strategy only.


> Few words about buffer option:
> Setting buffer to lets say 2, i could see that there are much more
> requests, and inside strategy-grid-grid object i can see that there
> are many more objects (tiles).
> But when i move my map just for 20px, new requests are being issued
>
> 2) Shouldnt I have at least 512px (tile size) before new requests are made?

This would indeed be expected. There's probably a bug somewhere.


> And one more question, featuresadded event is triggered for every tile
> loaded, thus it makes it little bit harder to see when all the
> features are loaded. What would be the right way to do it?

The loadend event type that you mention in your other email.

>
> I just saw that inside Grid.js
> /* FIXME addTileMonitoringHooks: function(tile) {
>
> that should answear my question. Any tickets for that issue maybe?

The grid strategy not being in trunk it isn't appropriate to create
tickets for it. If you want to work on the grid strategy, feel free to
check out the vector-behavior sandbox and commit changes on the grid
strategy code. It may be worth sync'ing the sandbox with the trunk
before anything.

If you're interested in having this strategy in trunk here's a (non
exhaustive) list of things that need be done:

- move the tileClass in a separate file, OpenLayers/Tile/Vector.js,
and rename the class OpenLayers.Tile.Vector
- change the OpenLayers.Tile.Vector:createFilter method so that it
passes an OpenLayers.Bounds instance instead of an
OpenLayers.Geometry.Rectangle as the BBOX filter value
- review the OpenLayers.Grid class, taking the FIXMEs into account
- make the OpenLayers.Layer.Grid class rely on the OpenLayers.Grid (so
that both OpenLayers.Layer.Grid and OpenLayers.Strategy.Grid use a
OpenLayers.Grid instance internally)
- review the OpenLayers.Strategy.Grid class, and make it support
reprojection (see the Fixed and BBOX strategy), make it trigger
"loadstart" and "loadend"
- add unit tests

I'd be very happy to do reviews and help move the grid strategy into
trunk if you and possibly other people are ok to help out.

Thanks,
--
Eric



More information about the Dev mailing list