I enjoy working with the Flex Openscales API for geospatial development. But the tight coupling drives me bonkers. Just add the drawing tool for example and see the side effects. Dropping in any of the pre-built tools is a major pain. That said, once one moves onto building custom tools, life become somewhat easier.

Flex Openscales

Openscales fully supports all OGC (Open Geospatial Consortium) standards. This includes web map service (WMS) and web feature service (WFS). Rather different to ArcGIS. The potential use of WFS in an Openscales mapping application offers some interesting possibilities. A WFS response provides the feature(s) geometry and attributes. Allowing Flex to draw each feature on top of the basemap or WMS layer. Remember WMS provides an image of a layer. This is rather like a QueryTask in ArcGIS, except we get the geometry and attributes of all features in a layer up front. We have to be careful with drawing times, particularly if there are many features in a layer. I’ve been building a template which takes the basic tools provided and adds additional custom modules. See this Openscales template. I’ll talk about it at more length in a different post.

Flex Openscales Map Demo

Figure 1 – Flex Openscales Map Demo

Here I want to discuss the identify tool

Openscales Identify Tool

The template uses EMS to display layer data. Select the identify tool and you can turn on a WFS layer to then identify features. Features will be drawn on the screen which one can then click on to see attributes. I have altered the default behaviour here. Looking at the Openscales API, it appears a server request is made to get these attributes (I’l need to confirm this). In this application we store the WFS features in an array. When a user clicks a feature we search the array for these features and get the attributes from these already loaded features. The Identify tool also allows searches.

Flex Openscales identify

Figure 2 – Flex Openscales identify

Thus a user can type in an owners name for example. The tool the again searches through the features array, finds all features with this owner and highlights them. Again now round trips to the server. Finally the application zooms to the extent union of these features ie. an extent which contains all these geometries. Again I will talk more about the template in due course. Here I wanted to share the code for the union of the extents, so we can zoom to the result set from the search


private function executeQuery():void
{
//Find matching features and highlight them
var componentCollectionArray:Array = new Array();
//For each layer in the map
for each(var item:* in _model.map.layers)
{
//Make sure we are working with the correct layer
if(item.params != null && item.params.service == "WFS" && item.name == "wfsParcel")
{
//For each feature in the layer
for each(var items:* in item.features)
{
//Search the stored features for user name typed in by the user
if(items.attributes['OWNER_NAME'] == ownername.text)
{
//Make selected feature yellow
items.style = SelectFeaturesHandler.defaultSelectedStyle(items);
//Generate a geometry object from the feature and store in an array
var geom1:Geometry = items.geometry;// as Collection;
componentCollectionArray.push(geom1);
}
}
}
}
//Create a collection object and pass the geometry array
var testcoll:Collection = new Collection(componentCollectionArray);
//Calculate the union of extents
testcoll.calculateBounds();
//Zoom to this new extent
_model.map.zoomToExtent(testcoll.bounds);
}

Related Resources

WebMapSolutions
Schedule Free ArcGIS Consultation
Our goal is to help you successfully apply ArcGIS to solve your business problems. Conducted by an ArcGIS expert, our free 30 min consultation will help move you forward.
Thank You. We will contact you as soon as possible.
SUBSCRIBE TO OUR BLOG
Our blog is filled with lively discussion, news, ideas. We take a fresh perspective on the rapidly changing world of GIS. Don't miss a post ... join over 1000 of your peers.
Do you want massive traffic?
Dignissim enim porta aliquam nisi pellentesque. Pulvinar rhoncus magnis turpis sit odio pid pulvinar mattis integer aliquam!
  • Goblinus globalus fantumo tubus dia montes
  • Scelerisque cursus dignissim lopatico vutario
  • Montes vutario lacus quis preambul den lacus
  • Leftomato denitro oculus softam lorum quis
  • Spiratio dodenus christmas gulleria tix digit
  • Dualo fitemus lacus quis preambul pat turtulis
* we never share your e-mail with third parties.
WebMapSolutions
CONTACT US
Are you looking for advice or help with ArcGIS? We are happy to share with you our thoughts and expertise to move you forward. Fill out the form below and we will be in contact soon.
Thank You. We will contact you as soon as possible.
WebMapSolutions
WORKSHOP SIGN UP
Our goal is to help get started and maximize GIS ROI. Conducted by on of our GIS experts, our free 1 hr Discovery Workshop will provide you a GIS road-map.
Thank You. We will contact you as soon as possible.
WebMapSolutions
Schedule a GeoAppSmart Demo
GeoAppSmart for ArcGIS we have designed with flexibility in mind. Let us show you how the app works. Fill out the form below, and we will contact you to set up a demo.
Thank You. We will contact you as soon as possible.
Request a Demo
Learn more about GeoAppSmart for ArcGIS. Schedule a demo. We can show you the features of this is a new breed on super flexible ArcGIS apps..
SUBSCRIBE TO OUR BLOG
Our blog is filled with lively discussion, news, ideas. We take a fresh perspective on the rapidly changing world of GIS. Don't miss a post ... join over 1000 of your peers.
Discounts!
Subscribe now to our free daily newsletter and get special offers and 20% discount.
More than just MOBILE .. All device ArcGIS apps are finally HERE!
GeoAppSmart for ArcGIS is one of a new breed of web based ArcGIS apps which:

  • Runs on any device - PC, laptop, smartphone, tablet
  • Can be used anywhere - Online or offline
  • Infinitely flexible - Built using plug-in tools
  • Easy to set up, configure and use

Download our new eBook, and learn more about these new super flexible web apps.
* we never share your e-mail with third parties.
New to ArcGIS Online and wondering how to GET STARTED?
Our free eBook 'Success with ArcGIS: Your Roadmap' will walk you through the critical success elements:

  • Defining the problem
  • Evolving the story
  • Building the runway
  • Solution implementation

If you are looking to JUMPSTART your deployment and use of ArcGIS Online this eBook is for you.
* we never share your e-mail with third parties.
S
Subscribe to Our Newsletter
Our newsletter is filled with news, tips, tutorials and lively discussion focused on the exciting, rapidly evolving world of GIS. Join over 2000 of your peers.
     
Wondering about Mobile GIS?
Our free eBook 'Your Guide to Mobile GIS' will help you get started and move forward with this exciting technology. We cover:

  • Your mobile GIS options
  • Provide case studies
  • Discuss best choices
  • Look ahead

If you are looking to improve how your mobile staff get their work done. This free eBook is for you.
* we never share your e-mail with third parties.
Want to get the most out of ArcGIS Online?
Our free eBook 'Success with ArcGIS Online' will walk you through the critical success elements including:

  • The Why
  • The Who
  • The How
  • The Where

If you are looking to get started or maximize your ArcGIS Online ROI, this eBook is for you.
* we never share your e-mail with third parties.
IoT on Map - Real-Time Reporting, Tracking and Monitoring Made Simple
Download our free Internet of Things eBook. Learn how to easily track moving assets, monitor fixed assets and report problems in real-time. Simple, flexible and affordable.
Want to get the most out of ArcGIS Online?
Download our free eBook 'Success with ArcGIS Online'. The eBook walks you through the key success elements: the why, who, how and where. Get started or maximize your ArcGIS Online ROI.
Sign up for our free GIS Discovery Workshop
Wondering how to get started or maximize your GIS ROI? Our free 1 hour workshop is designed to provide you a road-map to success with GIS. Sign up for it today.