[OpenLayers-Dev] (no subject)

Christopher Schmidt crschmidt at metacarta.com
Mon Oct 26 12:22:20 EDT 2009


On Fri, Oct 23, 2009 at 05:16:14AM +0200, Kris Geusebroek wrote:
> Hi All,
> 
>  
> 
> As a result of the BOF session @foss4g in Sydney I wrote up some
> thoughts on my companie sblog
> 
> http://blog.xebia.com/2009/10/23/taking-openlayers-to-the-next-level/
> 
>  
> 
> Please feel free to contact me especially for the HTML5 related stuff. 
> 
> When I'm back in Holland I want to make a start in trying out the HTML5
> canvas for drawing tiles, wms and vectorlayers so if anybody has
> attempted before or has any ideas about architectural stuff and how to
> fit it in OL please tell. 

Point by point response:

 1. "There are a lot of examples on how to use OpenLayers. The only problem is that these are not all written with the same style. Some of them are still using some old school way of dealing with the OpenLayers code."

This is simply the result of when the examples were written. In almost all
cases, the examples were written at the same time the code was, and use the
style that was appropriate at the time. Since things change -- especially
over the lifetime of approximately 3 years, which is the current age of the
OpenLayers 2.x series -- the examples have various vintages, and unlike a 
fine wine, documentation does not get better with age. 

If there was a substantial investment -- cash or effort from a highly 
knowledgable source -- this could easily be solved. There's nothing 
particularly complex about writing an example, but it requires someone
who knows the 'current best practices', has an eye for addressing the
needs of users -- despite them never having been stated, and doing it in
a way that is helpful. This is a substantial effort. I have no doubt
that someone could spend dozens of hours on building a good set of
examples. Generally, we focus more on the code, and the examples are a
best effort that points motivated people in the right direction.

 2. "Separation of UI look and feel"

Sure. Many people in the community would agree with that. It comes down
to effort, time, investment of energy into the problem. Solving these
things in a simple way is not trivial.

Note that controls are *not* complex; you can build OpenLayers without
support for any controls, and build all of your controls externally.
GeoExt *does* this, demonstrating that it's possible. There are some
things that could maek this easier, but it's not really neccesary to
'clean up' the existing code to fix this problem. If you think that
there is some kind of 'core functionality' to a control that is detached
from the UI and isn't available as API functionality, I'd be somewhat
surprised; can you think of something?

 3. "With the new html5 functionality around the corner..."

Anything that starts like this is likely doomed to failure :)

"it would be great if we can start using the geolocation api to for
example center the map on your current position"

Trivial. Been done in many OpenLayers apps; requires no OpenLayers
library level functionality.

"use a canvas for the map and its layers to minimize the dom
manipulation"

Using the Canvas to draw vector features is already supported.
http://crschmidt.net/mapping/choropleth-canvas.html is an example I
wrote more than 18 months ago to do exactly that; the code is all in the
OpenLayers library at this point. It has some benefits -- drawing is
faster when zooming, etc. However, there are downsides; when you give up
the DOM, for feature interaction, you have to switch to doing all of
your intersection detection in Javascript, which is slow. 

You also mention that this will somehow speed up IE, which has no native
Canvas support; only a translation through VML (and therefore, DOM
manipulation). I don't see how this is supposed to help improve
performance for IE.

Canvas is great for some things, but not for everything; the DOM is
pretty good at what it does, and for things other than vector features,
is rarely (though not never) the performance bottleneck. For vector
features, Canvas has some benefit for large numbers of features when you
don't need interactivity, but has the same *lack* of benefit in cases
where you do. 

" since i imagine the Map to be a 3d (or 2d) canvas where you can add
your image tiles and features from different layers."

I don't see what you see here as being different than what OpenLayers
is.

There are many things that OpenLayers does well, and many things it
could do better. For the sake of the project community, I think the
biggest thing to do would be to expand http://docs.openlayers.org/ to be
a fully fledged resource, incorporating a full explanation, enough to
cover what goes into the building of every one of the current examples.
If that was really the case -- if the documentation covered enough
information to make it possible for anyone to read the documentation,
then build a complete example -- then I think that the community would
be much better served.

There are also many features or other things which could be built upon
to improve OpenLayers which are not documentation. These things may be
neat and fun, though I tend to think they're not going to help the
community as much. Some of them may even speak towards drastically
reevaluation what OpenLayers should do and should be -- the UI vs.
not-UI controls stuff certainly falls into that role. I tend to think
those things are probably less important to the overall success of the
project, and I think many of them can be developed without changing a
single piece of the existing API -- simply using it in new ways.

Best Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list