Select to view content in your preferred language

Query/Live Layer Widget functionality in a NON-SFV App?

833
8
11-30-2010 05:36 AM
CarmenDurham
Occasional Contributor II
Hello all,

Has anyone done this already?  I really like the Live Layer/Query Widget capabilities and would like to use it in a more light-weight NON-SFV application.

Thanks,
Carmen
Tags (2)
0 Kudos
8 Replies
TracySchloss
Frequent Contributor
I'm interested in this as well.  I've gotten pretty far along with some code.  I'm not sure if anyone even looks at threads that are older than a few days, but I'll give this a shot rather than starting another thread.

This code reads the external config file, but I'm getting lost in the looping in a few places:
The querytask seems to be executing only after it's looped through both of the entries in the config.xml
The symbol for the picturemarkersymbol gets used twice.
The field name I'm using for the tooltip isn't getting read properly yet.

It does seem to be loading both layers from the config file though!

You'll need to have a few of your own images, I'm not providing those. 

I see that Robert Scheitlin has posted something similar for the search widget, but I didn't see that he'd done one for the live layer.  We got caught in that huge storm that hit so many states and it would have been nice to have this functionality separated out of the FlexViewer so I could have easily loaded different data into my own interface simply by updating my config file.  I'm in the minority, but I'm not a big fan of the FlexViewer interface.
0 Kudos
CarmenDurham
Occasional Contributor II
Tracy,

Thanks for responding.  I am still interested in this so I will take a look at what you submitted. 

The Sample Flex Viewer was awesome for getting started and learning a little about Flex.  It still has its place in our organization but we also saw the need for some applications for which SFV was not really the right fit and too "heavy" ( for lack of a better term).  When not using SFV, it seems easier to really customize to exactly what you want. I now prefer not using Sample Flex Viewer, but will admit that we would not have gotten to where we are today without it!  Obviously, I still like some aspects of it because I want the Live Layer Widget!

Carmen
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tracy,

   This fixes what you have done so far. I did not have anytime to spend looking at the overall design to really see if this is the best route or not.
0 Kudos
TracySchloss
Frequent Contributor
Thanks Robert.  I figured once I got past where this was stuck, I could look back into the code you'd written for the non-FV search window.  I think the components for recordData etc will likely apply.

I won't have a chance to do much with this the next few days, but I'll pick it up again later on next week.
0 Kudos
TracySchloss
Frequent Contributor
Now nothing at all seems to be drawing.  I'm also unclear when I should be nesting a function within another one.

Looking at my trace statements, it doesn't look like the onResult function gets called under after it loops through both of my entries in my function for the HTTPService call.  I would expect that the first entry in the config file would set the variables, then run the query task with the appropriate parameters and then go back to the HttpService function, set new parameters from the  next entry and go all the way through again.  That isn't what's happening. 

I'm wondering if I need to be firing off a dispatchEvent instead of just relying on the listeners.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tracy,

   The file I sent you was tested and functioning properly. I just replace your urls with some of my own for testing and development. The way the looping is working is kind of what you are thinking but not... When the first item is read in the config the query is sent and then the second layer in the config is read and query sent even before the first response is received. Looping and using a asynchronous query does not wait for one request to complete before continuing in the code.
0 Kudos
TracySchloss
Frequent Contributor
I did notice you have changed the wkid on the one layer that was getting drawn outside the config file.  (I tried the one you had first before I changed to the one I'm using.)  I'm puzzled why this code works for you and not for me.  Did you change anything in the config.xml?  I assumed not since you only posted code changes.

I'm off to our state GIS conference for the next couple of days.  I think there will be a few FLEX gurus there; maybe I can get some additional input.
0 Kudos
TracySchloss
Frequent Contributor
Found it!  I had changed the wkid of my map, but forgot to change the extent coordinates.  I've gotten tripped up more times over those two things!

Thanks Robert.  Now I'm going to be brave and see if I can continue on with some of your non-FV search window code.
0 Kudos