OpenLayers Blog

All the maps that are fit to blog

OL3 Sprint #2

September 24th, 2012 by ahocevar · Comments Off

This week, four developers (Eric Lemoine and Tom Payne for Camptocamp, Tim Schaub and Andreas Hocevar for OpenGeo) are getting together in Vienna to focus on OpenLayers 3 again, in a code sprint together with developers from GeoServer.

During a 1-week sprint with seven developers in June and in follow-up discussions, an agreement has been found on the flavor of the external API and the general architecture of OpenLayers 3. This week, we can build on the core that we already have. The main goal in addition to implementing features is to create a project infrastructure with a simple build process and good documentation, so other developers can more easily look at and work with the new code, and start to contribute.

You can follow our progress on

A big THANK YOU goes out to the Research Group Cartography at the Vienna University of Technology, for hosting the sprint. And another one to Camptocamp and OpenGeo for sending developers and covering travel and accommodation costs.

Comments OffTags: Uncategorized

OL3 Sprint

June 21st, 2012 by Eric Lemoine · 4 Comments

We are a group of seven people working on a new major version of OpenLayers this week:  Marc Jansen (Terrestris), Mike Adair (DM Solutions), Petr Pridal (KlokanTech / MZK), Tim Schaub (OpenGeo), Andreas Hocevar (OpenGeo), Tom Payne (Camptocamp), and myself (Eric Lemoine, Camptocamp).

Our goal for this sprint is to lay the foundations of what will be OpenLayers version 3. We have been talking about the high-level architecture, the API, and the tools we want to use for developing, building, and documenting the library. The first day was really about sharing ideas and knowledge, and eventually agreeing on a number of things.

We want to support different rendering mechanisms/technologies. We’re envisioning having two built-in renderers in OpenLayers 3, one that works with img/SVG/VML/Canvas (as OL 2), and the other that works with WebGL (Canvas 3D). The WebGL renderer will allow client-side manipulations and transformations of raster and vector data. Eventually it should be possible to tilt the camera, and see things in perspective. The OL 3 architecture will allow adding new renderers in the future, for example to provide some integration with 3D virtual globes.

Supporting multiple renderers requires an appropriate architecture, when the rendering-related code is isolated in specific objects, as opposed to being scattered across the library. (In OL 2 the DOM is omnipresent.)  The architecture we’ve come up with defines three core types: Map, Renderer, and Layer. The map is central, it is the main object with which the app developer interacts with. The map has a renderer, to which it delegates the rendering of the data. When the map is requested to move (either through a user action or programmatically) it sends a “draw” order to its renderer – “draw these layers for this center and resolution”. The renderer will then get data from the layers and render this data on the screen (or <imagine>any other media the renderer supports</imagine>). Layers are really data providers, they’re the interface/facade between the data services and the renderer.

Another thing we’ve been spending time on is the API. We want to provide an elegant and easy-to-use API. Here are a few examples

map ={
    renderTo: 'map',
    layers: [ol.layer.osm()],
    center: [5, 45],
    zoom: 10
Or, written differently:

map =
    .center([5, 45])
With the new API, the display resolutions, projection, and maximum extent are set on the map. The map is the master, it alone determines what projection and resolution to use. There is no longer a “baselayer” controlling these things.

Once a map is created you can, for example, do to get the center of the map (an ol.Loc object). And you can do[x, y]) to position the map to a new center. We’re obviously generalizing these jQuery-style getterandsetters across the API.

Another area that has required a fair amount of discussions is whether we want to use an external lib in OpenLayers or not. We have wanted to benefit from the Closure Compiler “advanced” optimizations for a long time. And our Closure fanboys in the room have shown, and eventually convinced, the other sprinters that using the Closure Library is necessary to fully take advantage of the Closure Compiler. So we’ve decided to give a try, without totally committing ourselves to it. I should mention that we’re already observing benefits from the use of the type checker.

That’s all for now. You can follow us on

→ 4 CommentsTags: Uncategorized


May 18th, 2011 by Tim Schaub · 1 Comment

We’re excited about Erik Hazzard’s new book on OpenLayers. We also wanted to promote Till Adams and Marc Jansen’s German OpenLayers book. Both are now featured on the OpenLayers homepage:

In addition, I’ve added a small donation button at the bottom of the page. Financial contributions to OpenLayers support both the OSGeo foundation and our project. Any size donations are welcome – if we get enough of a pool, perhaps we can have a documentation sprint and give the OpenLayers docs (and website) a much needed overhaul.

→ 1 CommentTags: Uncategorized

Simplified License for OpenLayers 2.11

May 17th, 2011 by Tim Schaub · 1 Comment

For the upcoming 2.11 release, we’re simplifying the license under which we distribute OpenLayers. We’ve chosen to adopt the more widely used 2-clause BSD License, also known as the FreeBSD License.

This new license differs from our old license in a number of ways:

  1. The new 2-clause license omits the non-endorsement clause. Our old license said that nobody could use the OpenLayers name to endorse products that use OpenLayers without specific written permission. There are many existing uses of the OpenLayers name in promoting software that uses OpenLayers, and in practice we were not enforcing this non-endorsement clause.
  2. The new 2-clause license doesn’t contain any language about patent rights. Our old license included language about patent rights that was not included in other common forms of the BSD. Removing this specific language aligns our license with licenses used by many other projects – reducing the chance of licensing questions that are specific to our project.

We hope that this licensing change makes it even easier for more organizations to use OpenLayers in their web mapping solutions. Let us know if it raises any concerns.

→ 1 CommentTags: Release

More work on mobile and 2.11

April 2nd, 2011 by Eric Lemoine · 31 Comments

Three of us, here at Camptocamp, sprinted three days on OpenLayers. Our goal was two-fold: close tickets for the upcoming 2.11 release, and improve our mobile story, following up on the work done during the mobile sprint (see the previous posts on this blog).

Day #1

We started out by reviewing patches, and closing tickets, for 2.11. We closed a dozen tickets, getting us much closer to the 2.11 release. Some of the new features now in trunk include:

  • New icons for the navigation toolbar, see the navigation toolbar example (patch from Xavier Mamano).
  • Support for OpenLS (Location Service Utility), see the OpenLS example (patch from Bart van den Eijnden).
  • Remove dependencies between scripts to be able to produce smaller single file builds (patch from Frédéric Junod.

Day #2

On Day #2 we spent some more time on bug fixing (and ticket closing) for 2.11, and then switched to improving our mobile support.

  • We spent a great deal of time on many (not so) small Android WebKit-specific issues. The browser often reacts to user actions, causing nasty effects like flashes if no proper action is taken in the JavaScript code.
  • We started reviewing Tim Schaub’s Canvas Hit Detection patch. This patch will give us feature selection on Android, it isn’t committed into trunk at time of this writing but Tim will certainly do it in the coming days.
  • We worked on feature drawing, refactoring code and tests, making feature drawing more solid in every supported mobile browser. See the draw feature example.

Day #3

Day #3 was mainly about mobile again.

  • And mainly about Android again… we committed patches preventing Android’s default behavior, and researched why Android “flashed” the map when two quick taps, apart from one another, occur. There’s stil some work left for a perfect Android story, but code and knowledge have improved a lot.
  • We finished reviewing Tim’s Canvas Hit Detection patch, and reviewed and committed other patches for 2.11.
  • We completed “select feature” support, and added support for “drag feature” and “modify feature”. We modified the mobile drawing example to be able to demo these new features. Go check out the mobile drawing example. (in Android or iOS)!

So, overall, lots of progress on the mobile front, and just a few tickets away from OpenLayers 2.11!

→ 31 CommentsTags: Uncategorized

Mobile Sprint: Day Five

February 25th, 2011 by Tim Schaub · 10 Comments

We’ve officially wrapped up the OpenLayers Mobile code sprint. This week has brought a very welcome infusion of energy to the project. I think it is safe to say that all involved have felt we have achieved the goals we set out for ourselves at the start of the week. In addition to significantly enhancing the capabilities of the library (and perhaps more importantly), the project got an infusion of new lifeblood. We want to express our gratitude to to Cédric Moullet and Claude Philipona for organizing the event, and thank those who sponsored the event for bringing us together:

Today we were able to able to pull in a number of enhancements that had been cooking for the past few days. In order to improve map navigation performance, OpenLayers now limits the pixel to map translations that occur during dragging. This provides a noticeable gain on both older devices and large display touch devices (iPad). Give one of the mobile specific examples a try on your touch device to see how it feels (and compare to an example from our last release to see how far we’ve come).

While OpenLayers will still not have any dependencies to external libraries, we want to showcase how well OpenLayers works with existing frameworks for mobile application development. The jQuery Mobile and Sencha Touch examples show how mobile specific frameworks can be used in building applications with the newly developed OpenLayers functionality.

A typical OpenLayers application will use a small fraction of the functionality available in the library. In order to build responsive OpenLayers applications, it is important to assemble a limited build of the library – with just the components that your application needs. In the spirit of practicing what we preach, we’ll soon be hosting examples of limited builds for the mobile examples, and the OpenLayers build tool will allow you to use the Google Closure Compiler to create your own minified builds.

As demonstrated in the examples above, we’re also excited about the inclusion of pinch-zoom functionality in OpenLayers. On multi-touch devices, you can now smoothly zoom around in your OpenLayers applications by using the touch navigation control (this will likely be enabled by default in the standard navigation control before the next release).

In addition to the features already in the OpenLayers trunk, this week produced a number of enhancements we’ll be working into the trunk over the upcoming days. Soon (likely before you start work on Monday), we’ll have support for editing vector features on mobile devices. In addition, we bring in a vector layer protocol for local storage of vector features while offline.

I think it is fair to say that for all those involved, this week’s OpenLayers code sprint was a resounding success. Our only regret is that the week has come to an end – and we hope to find another opportunity to come together again. We’re particularly grateful to our sponsors who assumed some risk in bringing us together without any guarantee about what we could deliver. In the end, we’re proud of what we have accomplished, and want to thank the sponsors for helping us bring mobile support to the broader community of OpenLayers users.

→ 10 CommentsTags: Features · Sprint

Mobile Sprint: Day Four

February 24th, 2011 by Tim Schaub · 6 Comments

Day four already!? Not sure what happened to day three (perhaps we all forgot to sleep). After picking off the easy wins at the start of the week, we’ve spent the past two days wrestling with some of the tougher issues that come up when you target a broad array of devices in an area of evolving technology.

OpenLayers prides itself on our solid support across a few generations of browsers from a variety of vendors. This week’s sprint brings us into the free-for-all world of mobile browsers. We now support intuitive touch dragging on iOS and Android devices. For browsers without full touch drag functionality, OpenLayers maps can be “tapped” to recenter.

Another nice usability feature in today is the ability to pan while drawing. Tomorrow, we’ll continue work towards allowing feature editing on mobile devices.

Much of the recent sprint activity has been going on in OpenLayers sandboxes. Tomorrow we’ll make a big push to get as much of this functionality into the trunk as we can. The pinch sandbox demonstrates the much anticipated smooth pinch zooming.

In addition we should have solid examples demonstrating OpenLayers in use with Sencha Touch and jQuery Mobile (note of caution: sandbox examples may be non-functional at any time and will be very slow to load as they use the debug version of the library). Also in the works are examples of local storage for vector features and raster tiles.

All of the new mobile related functionality will be available in the next release of OpenLayers. We hope to iron out remaining issues over the next few weeks and then start the release process for 2.11.

→ 6 CommentsTags: Features · Sprint

Mobile Sprint: Day Two

February 22nd, 2011 by Tim Schaub · 7 Comments

We’ve wrapped up our second day in Lausanne, making good progress on a number of fronts.

OpenLayers Mobile ExamplesOur examples have always been the richest source of learning material for OpenLayers newcomers. The example search page got a well deserved overhaul today – making it more convenient to find relevant code samples. In addition to the nicer layout for mobile and desktop browsers, you’ll also get results for partial word matches from the search box.

For browsers that support the Geolocation API, the new Geolocate control allows OpenLayers based applications to easily retrieve positions and deal with position updates.

You can now grease up your slippery maps with kinetic panning. By setting the enableKinetic to true on your DragPan control, you’ll build momentum while drag-panning and slowly lose it after releasing the map.

If you’re only targeting touch enabled devices with your mapping application, you can use the new TouchNavigation control. Our default Navigation control is mobile ready by default, but you can generate a smaller build of the library if you’re only handling touch related navigation.

Work continues on other fronts as we design example applications for both jQuery Mobile and Sencha Touch, dig for performance enhancements, explore offline storage strategies, look for ways to support touch-limited devices, and, oh yeah, fix bugs (sorry Android draggers). Keep an eye out for new mobile examples and other updates.

→ 7 CommentsTags: Features · Sprint

Mobile Sprint: Day One

February 21st, 2011 by Tim Schaub · 11 Comments

A solid group of OpenLayers developers and power users have gathered in Lausanne to bring OpenLayers into the mobile age. Today (and yesterday) we spent some time getting organized and laying the groundwork for the week ahead.

Each of our examples got a nice, mobile friendly layout thanks to Antoine Abt (resize your browser with any of the examples or view one on a small device to see how the layout changes). Before the end of the week we should be able to have an index page that’s more usable on mobile devices as well. Our tests have become a serious hassle to run – given the number of test pages to load and the size of the uncompressed library (which we hope nobody uses in production). Pierre Giraud gave the test runner a boost by enabling it to optionally run with a built profile of the library (you can do the same with an OpenLayers.js file in your build dir and a mode=build query string in the runner URL). This gives us hope of running the tests without timeout trouble in more environments.

Eric Lemoine committed a fix for our drag handler to work with touch events. This gives us basic drag-panning navigation on touch enabled devices. Following this, Eric put in a nice fix to the click handler to work with taps and double taps. By default your maps will now have drag panning and double-tap zooming on touch devices. Thanks to Bruno Binet and everyone else for pulling these patches together. With these changes in, I made changes to event handling and a couple controls so that both mouse and touch events should be handled as expected. Now the out-of-the-box controls that OpenLayers ships with work similarly on touch- and mouse-centric environments (the overview map still needs some love).

Gaining better performance for limited resource devices is a major goal of our work this week. Andreas Hocevar did some promising investigation into alternatives for positioning & resizing tiles to get continuous or animated zooming. In addition, he’s overhauling the map dragging code flow to avoid a whole lot of unnecessary work (he promises us things will be 10X faster by morning – hope you get some sleep Andreas!). Also on the performance theme, Marc Jansen put together a patch that will let us optimize and minify the stylesheets that load with OpenLayers apps.

Chris Schmidt landed mid-morning and hopped right into event handling research on the fat stack of devices he hauled over the Atlantic (we think his originally scheduled flight couldn’t take off due to excess baggage). Chris is working hard to make sure we’ve got broad coverage in terms of device support.

Adding to the slick navigation features, Stéphane Brunner finished up a patch to support “kinetic” panning. When this is in, your maps will gain momentum while drag panning and will gradually slow when you release them (though you can always put on the brakes with a light touch). Bart van den Eijnden worked with building apps with Sencha Touch and assisted on other features. Frédéric Junod did some cleanup and paired on other patches.

In the R&D department, Jorge Gustavo Rocha and Jennie Fletcher organized on offline browsing and offline editing capabilities – a key part of the mobile map story in areas with limited coverage. Cédric Moullet explored handling of device motion events, and Igor Tihonov worked on … ack, I forgot to catch up with Igor at the end of the day – apologies! Benoit Quartier worked on testing and offered logistical support.

Sincere thanks to our generous sponsors for making this week possible. It is a real pleasure to get to be here together making this happen (finally!). And to Claude Philipona and Cédric, big thanks for pulling it all together.

→ 11 CommentsTags: Features · Sprint

CQL Parsing

January 31st, 2011 by Tim Schaub · 3 Comments

When using rule based styling or constructing queries for features, application developers often hand-code their filters. For example, if you wanted to style or select a subset of US State features that started with the letters B through O, you might create a filter that looked like this:

var filter = new OpenLayers.Filter.Logical({
    type: OpenLayers.Filter.Logical.AND,
    filters: [
        new OpenLayers.Filter.Comparison({
            type: OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,
            property: "STATE_ABBR",
            value: "B"
        new OpenLayers.Filter.Comparison({
            type: OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,
            property: "STATE_ABBR",
            value: "O"

Using the OGC Common Query Language, this same filter would be expressed with the following string:


With the new OpenLayers.Format.CQL parser, you can now convert from one to the other. This makes hand-coded rule based styling far easier to manage, and it provides a way to concisely serialize filters for services that support CQL. See the OGC Catalog Specification for more detail on CQL, and find some good examples in the GeoServer documentation.

Thanks to David Winslow for this excellent contribution.

→ 3 CommentsTags: Features