[OpenLayers-Users] tiling features to speed detecting features on
graham.carlyle at maplecroft.com
Wed Apr 16 06:38:08 EDT 2008
In a previous post I said that I wanted to detect which feature a mouse
had clicked on at the client side in order to be more responsive. The
suggested solution worked well, that of downloading a geojson
representation of the features up front and using the 2.6 OL feature of
detecting whether the feature's geometry intersected with the mouse
However for large maps, downloading the features in geojson (or another
format) of the required detail for all zoom levels for detecting which
feature is being clicked on is prohibitively large.
So this got me thinking, how about tiling the feature information, or
rather the geometry associated with it?
On the server side I can see a way of hacking TileCache to generate a
geojson feature "tile" by clipping the feature geometry to the tile
bounds and then quantising the geometry by the tile resolution (using
some shapely, worldmill & geojson sauce).
On the client side a new type of OpenLayers Layer would download these
feature "tiles" in parallel with the image tiles and provide access to
the "visible" features for mouse click detection etc.
I don't need to do this but I guess you could also render these "tiled"
features and possibly get around some of the browser problems of
rendering vector layers with too many vectors or vertices because of the
geometry simplification of the tiling & quantisation.
Is this madness? Am I missing something that exists already that would
achieve what i want.
More information about the Users