Dynamic Map Legend compile OK but no live layers now.

597
4
07-23-2010 01:24 PM
NathanEnge
Esri Contributor
I've utilized the code the RS has here: http://forums.esri.com/thread.asp?c=158&f=2421&t=299116&mc=137#934254
SubjectRe: Map Legend Widget Part II AuthorRobert Scheitlin DateJan 20, 2010 MessageLets try again third time is a charm...


All,

If you are using my original code than you will want to replace everything to include the asp.net web service as this new service is required to enable multiple Map Services to be used. I hope I made things a lot easier for every one by including a setup for the web service and the source code for the web service as some will have to modify the web service when running into the issue of legend swatch urls not having their servers fully qualified name. Robert Scheitlin
GIS Manager
Calhoun County, Alabama FlexViewerLegend3.zip (opens in new window)


It compiles fine. However now, I don't see my my live layers on the map, I can see them in the query builder widget and can see the attributes. but the symbology is all gone. Also, my live layers widget still does not have the ability to switch to the legend.

My steps were to extract all the new files from the zip file to the appropriate directories, then go through RS's mapmanager and live layers widget mxmlas well as the .as file, to copy in the code that was different (as I already made mods to my original stuff).

I am attaching src directory containing: mapmanager, live layers, config, as well as the modified .as file.

my flex app is here:
http://www.mapservices.ca/bin-release/

my two live map services are here:
http://www.mapservices.ca/ArcGIS/rest/services/ADK/MapServer
http://www.mapservices.ca/ArcGIS/rest/services/OilGas/MapServer

my map legend service is here
http://www.mapservices.ca/restLegend/restLegend.asmx?wsdl

any help would be appreciated.
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Nathan,

   The SFV 1.3 has two livemapwidgets in it you are likely editing the livemapswidget in the flexviewer folder but the one that your app is using is the one from the esa folder.
0 Kudos
NathanEnge
Esri Contributor
Hi Rob,
I just hit myself in the head for not noticing that. Thanks a lot. However, I still have issues with my two map services not displaying. I can use the Query Builder and see my two map services, and can actually do queiries with zoom to, and highlight. However, still no displaying (I have another map appolication going that references the same two map services correctly). It compiled fine. On the live maps widget, when I switch to legend I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.solutions.flexviewer.widgets::LiveMapsWidget/createRepeaterData()
at com.esri.solutions.flexviewer.widgets::LiveMapsWidget/getLegend_result()
at com.esri.solutions.flexviewer.widgets::LiveMapsWidget/___LiveMapsWidget_Operation1_result()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()


Any ideas why?

Oh and that zip file I attached is weird. You have to download it, extract that content (src) with winrar. then rename that src to src.zip then extract normally. I don't know why it did that. my zips are uploading fine, but downloading it gets screwy.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nathan,

   Your issue now is with the proxy in the mapmanager.mxml. Comment out line  177
//dynlayer.proxyURL = configData.proxy;
0 Kudos
NathanEnge
Esri Contributor
Thanks RS !
An enhancement that I'm trying to work on right now is to get the legend icon onto the shortcut bar on the banner. When the user clicks on the legend shortcut, it would activiate the liveMapsWidget and flip directly to the Legend index (2) viewstack.

There really isn't an easy way (for me a novice coder) to do this. One workaround that I thought about was to add the live maps widget back into the shortcut bar, change the icon of livelayer to my i_legend.png instead of the current i_layer.png, then flip the indexes around as well as the Viewstacks so that Legend appears first, all the time. I tried this and I still needed to click on the legend button to activate the legend creation process.

But is there anything cleaner than this. I do want to retain the i_layer.png for Live Maps widget, and just want a shortcut to activate the live map widget with the legend viewstack selected.

I have created a separate web app to demo what I mean:
http://www.mapservices.ca/bin-release/
0 Kudos