Sponsored Links

Technical Overview: OpenScales PDF Print E-mail
Written by Richard Marsden   
Monday, 19 April 2010 06:36

OpenScales is an open source mapping framework for ActionScript 3 and Flex. Supporting a range of OGC data protocols, it has many similarities to the OpenLayers framework but uses Flash rather than JavaScript. The combination of Flash, 'tweening', and fast data providers results in a smoother, more compelling user experience - remniscent of Bing Map's new Silverlight control.

 

The similarity between OpenScales and OpenLayers is not a coincidence. OpenScales was initially created from FlexLayers, a Flex port of OpenLayers called FlexLayers. Although OpenScales does not have exactly the same interface as OpenLayers, the similarities are such that an OpenLayers developer should be able to quickly develop working applications.

OpenScales is currently at v1.1, and currently supports Adobe's ActionScript 3, Flex, and AIR platforms. It is distributed under the LGPL license.

In common with OpenLayers, the architecture is based around layers which can support a range of data layers. These include:

  • FeatureLayer - Allows individual geographic features to be 'drawn'
  • ImageLayer - Bitmaps
  • WMS - OGC Web Mapping Services
  • WFS - OGC Web Feature Services
  • KML - Keyhole Markup Language
  • Mapnik - Mapnik OpenStreetMap layers
  • CycleMap - OpenStreetMap Cycle Map layers
  • Osmarender - OpenStreetMap Osmarender layers

 

Support for OGC web services is to be expected in a modern open source web mapping client, and is served with support for both WMS and WFS. Of particular note is the strong support for a range of different OpenStreetMap web services.

OpenScales also supports a range of controls and components. These include the 'essentials' (ie. layer switching, zoom/pan, overview map, scalebar), as well as a drawing toolbox, cursor position, spinner, and traceline (log display). The drawing toolbox is a useful addition, as this is a common 'how do I?' query on the support forums for most other web mapping systems.

Planned future releases include support for WMS 1.3, GML 3, and AMF3 vector support, and 3d support. 3d could be an interesting addition, although suitable data might be scarce.

So what does it look like? Here is a demo of the WMS-C GetFeatureInfo request from the OpenScales samples:

WMS-C GetFeatureInfo demo for OpenScales

 

This map can be navigated using the standard zop & pan. Note the scalebar in the lower right, and the current mouse coordinate in the lower left. A location has been selected in Lower Manhattan (the yellow square), and a pop-up window shows information about it (it is a church).

Here is the code that produced the above map:

  1 
  2 
  3 
  4 
  5 
  6 
  7 
  8 
  9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
 19 
 20 
 21 
 22 
 23 
 24 
 25 
 26 
 27 
 28 
 29 
 30 
 31 
 32 
 33 
 34 
 35 
 36 
 37 
 38 
 39 
 40 
 41 
 42 
 43 
 44 
 45 
 46 
 47 
 48 
 49 
 50 
 51 
 52 
 53 
 54 
 55 
 56 
 57 
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns="*"
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:os="http://openscales.org"
         creationComplete="initMap();">

    <os:Map id="fxmap"
            width="100%"
            height="100%"
            zoom="5"
            centerLonLat="4.833,45.767">

        <os:TraceInfo x="{width-200}"
                      y="0"
                      visible="{displayTrace}"/>

        <os:WMSC name="Nasa"
                 url="http://openscales.org/geoserver/gwc/service/wms"
                 layers="bluemarble"
                 format="image/jpeg"
                 maxExtent="-180,-90,180,90"
                 isBaseLayer="true"/>

        <os:MaxExtent left="-180"
                      bottom="-90"
                      right="180"
                      top="90"/>

        <os:Spinner id="spinner"
                    x="{width / 2}"
                    y="{height / 2}"/>
        <os:MousePosition x="10"
                          y="{height-20}"
                          displayProjection="EPSG:4326"/>
        <os:BorderPanHandler/>
        <os:PanComponent/>
        <os:ClickHandler/>
        <os:WheelHandler/>
    </os:Map>

    <mx:Script>
        <![CDATA[
            import org.openscales.core.Map;
            import org.openscales.core.Trace;
            
            [Bindable] private var map:Map = null;
            [Bindable] public var displayTrace:Boolean = false;    
            [Bindable] public var displayFirebugTrace:Boolean = false;

            private function initMap():void {
                Trace.useFireBugConsole = displayFirebugTrace;
                map = fxmap.map;
            }
        ]]>
    </mx:Script>

</mx:Canvas>


Notice that the actual source code is very short. Most of the map is defined as a series of XML records. This makes it very quick and easy to develop a functioning map. Although OpenLayers is very extensible, it typically requires a lot more code to produce the same effect.

OpenScales is a powerful toolkit supporting most of the features in OpenLayers, plus a few useful ones of its own. Its success or failure is going to depend on the success or failure of the various Adobe web technologies (ActionScript, Flex, AIR), and many in the industry think ActionScript's days are numbered. Despite the simplicity and promise of 3d, I doubt many developers will adopt these technologies just to use OpenScales, but if you are already an ActionScript/Flex/AIR developer, then OpenScales has a lot to offer. Indeed, it is probably your best choice for a range of different applications (eg. ones where you are running own web map services).

Further information, downloads, documentation, and tutorials can be found on the main OpenScales website at http://openscales.org/ .


Comments (3)Add Comment
0
OpenScales 1.2 at FOSS4G, I hope !
written by Bouiaw, April 22, 2010
Hi,

Thanks for this nice OpenScales 1.1 technical review.

We have published a few days ago the OpenScales 1.2 roadmap, and we will hopefully be at FOSS4G 2010 to talk about OpenScales 1.2 if the presentation we have submitted is selected.

We are working on nice improvements for this next release like :
- Switch from Subversion to Mercurial for our sources
- Upgrade to Flex 4 with Flash 10.1 runtime
- Improved and simplified Style API
- Free zoom (without fixed levels)
- Map rotation
- 3D world zoom thanks to globe layer support
- Optimized vectors based on AMF3/Remote Object
- AIR 2.0 desktop applications with shapefile support

So stay tuned ;-)

Bouiaw
OpenScales founder
0
Yes, OpenScales will be at FOSS4G 2010
written by ABA, May 31, 2010
See you at Barcelona: http://2010.foss4g.org/
0
Openscales 1.2 Beta has been released
written by Romaric Pascal, August 18, 2010
After the announcement some months ago, OpenScales 1.2 has finally been released in beta version yesterday. You can grab it on the Openscales website : http://openscales.org.

Write comment

security code
Write the displayed characters


busy
Last Updated on Monday, 19 April 2010 06:39