OpenLayers Blog

All the maps that are fit to blog

Promotion

May 18th, 2011 by Tim Schaub · No Comments


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: http://openlayers.org/

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.

→ No CommentsTags: Uncategorized

Simplified License for OpenLayers 2.11

May 17th, 2011 by Tim Schaub · No Comments

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.

→ No CommentsTags: Release

More work on mobile and 2.11

April 2nd, 2011 by erilem · 9 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!

→ 9 CommentsTags: Uncategorized

Mobile Sprint: Day Five

February 25th, 2011 by Tim Schaub · 9 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.

→ 9 CommentsTags: Features · Sprint

Mobile Sprint: Day Four

February 24th, 2011 by Tim Schaub · 4 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.

→ 4 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:

STATE_ABBR >= 'B' AND STATE_ABBR <= 'O'

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

Bing Tiles for OpenLayers

December 18th, 2010 by ahocevar · 15 Comments

As of today, OpenLayers has a new layer type: OpenLayers.Layer.Bing. “Why that” you may ask, “there is OpenLayers.Layer.VirtualEarth already”. So why is this new layer type so special? It is the first time that we access tiles from a commercial service directly. Others (e.g. Google Maps) do not provide direct access to their tiles, but Microsoft does through the Bing Maps Web Services. We from the OpenLayers community appreciate this a lot, because it has several advantages over accessing commercial tile services through their JavaScript APIs:

  • No need to include extra JavaScript in your application
  • Better integration with OpenLayers, because things like dragging, transition effects or tile buffer are directly controlled by OpenLayers
  • Better performance because tiles are accessed as image resources, and not through an external JavaScript API

Recent experience with the Google Maps v3 API has shown that using external APIs in OpenLayers can be error prone:

With direct tile access, Bing Maps is now the best choice of commercial map tiles for OpenLayers. And the usage is simple:

  1. Get an API key at http://bingmapsportal.com/. This API key is not bound to an application url or domain.
  2. Create a map with an OpenLayers.Layer.Bing instance, configured with the API key. Below is a minimal example.
var apiKey = "your api key here";

var map = new OpenLayers.Map( 'map');

// Bing's Road imagerySet
var road = new OpenLayers.Layer.Bing({
    key: apiKey,
    type: "Road"
});
// Bing's Aerial imagerySet
var aerial = new OpenLayers.Layer.Bing({
    key: apiKey,
    type: "Aerial"
});
// Bing's AerialWithLabels imagerySet
var hybrid = new OpenLayers.Layer.Bing({
    key: apiKey,
    type: "AerialWithLabels",
    name: "Bing Aerial With Labels"
});

map.addLayers([road, aerial, hybrid]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();

OpenLayers.Layer.Bing uses the Bing Maps REST Services to retrieve metadata that is required to access the tiles. The “type” config option for OpenLayers.Layer.Bing can be any of Bing’s imagerySets, except for those with Bird’s Eye imagery.

Credits

The idea to create this layer type was born during a “NYC work week” hosted by OpenGeo, when Tim Schaub and I discussed problems with the Google layers in OpenLayers that collegues from OpenPlans had made us aware of. Unfortunately we were too busy to implement it during that week, but I created a patch for it the following weekend. Thanks to Justin Deolivera from GeoServer for providing Sierra Nevada Pale Ale and the UFC stream from Montreal, which gave this coding task a recreational setting. Yesterday the patch was reviewed and made even more solid by Tim. Now it is available in OpenLayers trunk, and will be shipping with the next OpenLayers release.

→ 15 CommentsTags: Features · Future

OpenLayers in Barcelona

August 6th, 2010 by Tim Schaub · No Comments

The one month countdown has begun for the FOSS4G 2010 conference. As with previous conferences, OpenLayers features heavily in the program. Here’s this year’s list of selected presentations mentioning OpenLayers in the titile:

If yours is one of the presentations on that list, start preparing! If not, register for the conference and we look forward to seeing you there.

The workshops are a great way to get hands-on experience with OSGeo software. The OpenLayers workshop just filled up.

FOSS4G 2010 Workshop

If you didn’t get signed up in time and bang on the door really hard, I’ll see what I can do about getting you in :)

→ No CommentsTags: Conferences