Geospatial – Actualités

OpenLayers Code Sprint

14 septembre 2010

The OpenLayers dev team met on IRC one or two months ago to define what OpenLayers 3 could be. Among other things we decided that the map should be the place where the projection, resolutions and maximum extent are defined, and that it should be possible to reproject the map.

Being able to reproject the map is something that has been wanted since long. For example, geographic institutes, like IGN, need maps covering the world, with local projections when zooming in specific territories.

At the FOSS4G code sprint some of the OpenLayers developers sat down and worked together on designing new APIs for OpenLayers 3. So we worked on new APIs for easily creating maps with layers, and reprojecting maps.

For example, we want that creating a map with a Google layer to be as easy as:

var map = new OpenLayers.Map({
    div: “map”,
    layers: new OpenLayers.Layer.Google(),
    center: [5, 45]
});

Likewise, creating a map with a WMS layer should be as easy as:

var map = new OpenLayers.Map({
    div: “map”,
    layers: new OpenLayers.Layer.WMS({
        url: “http://example.org”,
        layers: “foo”
    }),
    center: [5, 45]
});

Reprojecting the map will be done with calls like:

map.setProjection(”EPSG:900913″);

This will change the map projection, resolutions, etc., reproject the layers than support the new projection and turn off the others.

We’re also looking at removing the overlay/baselayer paradigm, and making the map a central place, where the resolutions, the projection, etc. are configured.

So the code sprint basically involved writing down use cases we want to cover (through usage examples as those provided above). On our flight back from Barcelona, Bruno Binet and I translated these use cases in automated tests (all committed in my OpenLayers GitHub branch).

There still is a long way before we get the implementation done, but I think we’ve come up with a nice design, and promising APIs. I guess we’re all looking forward to actually implementing this design, and showing real examples.

Code sprints are great, they’re the best way to make our open-source projects evolve and improve. At this point I think we’d all agree that, to make OpenLayers 3 actually happen, we’d need another code sprint of 4-5 days. Code sprinting in the french Alps some time in 2011 was mentioned a couple times during the FOSS4G week. I’m really hoping we can find funds/sponsors for this, and make OpenLayers 3 a reality!

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *