Select to view content in your preferred language

Flex API based Application   vs.   Flexviewer Application

637
3
11-27-2012 06:36 AM
ScottDawson
Emerging Contributor
I'm not sure if this should be in the ArcGIS Api forum, or the FlexViewer forum so I figured I'd have a 50-50 chance at picking the right one regardless!

I currently have an application built with the Flex API 2.5.  It's a database (ie. parameter) driven application and can utilize one of many different ArcGIS map services based on what "study"  the user is accessing.  I'm getting the URL for the map service when I launch the Flex App from within a web page example below:

<esri:ArcGISDynamicMapServiceLayer id="dynamicService"  
        name="Map Legend"  url="{FlexGlobals.topLevelApplication.parameters.servicePath}" load="dynamicService.defaultVisibleLayers()">



New "Studies" are created all frequently, each with it's own Map Service.  The application works well. I am utilizing  the Legend Component.

The product owner has seen several FlexViewer Samples and wants to know if I can make my application look more like the FlexViewer samples. Specifically they like the Legend Widget!!   I do too for that matter.

My question is basically, Are there any good examples out here of incorporating more of the "Widget" based model like FlexViewer into an existing Flex API based application?  My impression reading the FlexViewer is that it's more designed around a single map service.  Am I reading too much into the FlexViewer description as a tool for "Non-developers"  to make Web Mapping Apps?  Are these 2 completely different tools for completely different use cases?

Sorry if these ?'s have been answered before, but I couldn't find a real good answer and I'd like to give the product owner some sort of guesstimate as to the scope of incorporating specific widgets in an existing application.

Thanks
Tags (2)
0 Kudos
3 Replies
Drew
by
Frequent Contributor
Scott,
Essentially a "widget" is just a bunch of code wrapped in a container and the "FlexViewer" knows how to load  & display that container. There are some events and variables that are specific to the FLexViewer, but nothing out of the ordinary.
If I understand your question correctly you could simply rip out code from a widget and with little modification you could add it to a custom application. As mentioned there would be some modifications needed to make it work, but if you have a good understanding of actionscript you can make it work.

To make a modular base application like the Flex Viewer, you would have to learn Flex Modules. There is a lot on google.
https://www.google.ca/search?q=Flex+Modules&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&cl...


Hope this helps,

Drew
0 Kudos
TracySchloss
Honored Contributor
You will find example throughout the forum of specific widget that people have "lifted" out of the Flex Viewer to be used within a basic FLEX API (non-Viewer).  I recall the Legend Widget in particular has several threads about it.  In general though, Flex Viewer is designed to work with itself.  Users develop additional widgets for added functionality or modify existing widgets to have slightly different behavior.   I would not consider myself either a "newbie" or an advanced developer, somewhere in the middle.  Personally I found it difficult to copy enough of the widget code to work in my standalone FLEX API (none of my work is based on viewer). 

I would not say you are limited to a single map service if you are creating your applications from scratch.  You do get that impression looking at the samples because they are all very plain.
0 Kudos
ScottDawson
Emerging Contributor
Andrew and Tracy,  thanks for the replies and the link. 

This has provided a good sanity check that I'm at least understanding the paradigms.  I wouldn't consider myself a Flex expert, nor a newbie either.  I at least feel fairly confident that I'm not completely misleading anyone in the ease/difficulty of the task.

Thanks again.

Scott
0 Kudos