Tuesday, March 29, 2011

Another Enhanced TOC/Legend Widget

I don't like an idea of separating TOC and legend. Maybe I am an old-fashion guy, but I like to have a widget where I could see icons and names, turn on/off layers, tell whether or not a layer is in its display scale range. And it has to handle sublayers because I have a lot of layers with subtypes. It would be cool if I could click a layer and see the layer properties. It doesn't have to show all of them, but just some major pieces. You know, something like the TOC in ArcMap.
And some of my friends are still using 9.3.1 and others have gone to 10. The widget should work for all of them, although I wouldn't mind telling them that it runs faster and more smoothly with 10.
If you were like me, take a look at this widget (http://www.arcgis.com/home/item.html?id=cd57c351fb9a4167853c04ec9380c8b1). You may like it. It's a beta version developed on FlexViewer 2.2.

Revision: 3-27-2011
1. added labels into config.xml
2. added displayMode into config.xml for a collapsed or expanded mode (thanks ryonwithano for the great suggestion)
3. added buttons to expand or collapse all layers
4. added search layer by keyword
5. set a hand cursor for clickable images

Revision: 3-29-2011
1. improved the error handling
2. added the support for a tiled map service
3. fixed the layers ordering bug (thanks webmapper123 for reporting the bug)

Let me know what you think.


ArcGIS Legend Widget Test Result for jtlewis

Hi Jtlewis,

I ran the widget on your service link. It worked fine with me. Here are the screenshots. 
Well, for the testing purpose, the layer was the only one in the OperationalLayers tag. Have you tried to test the widget only on that URL in your environment? Did the widget fail on any other layer in the same host server? If you could send me the error message, I would look into further for you.
I am guessing... Could it be you have too many layers, causing the timeout?  

Sunday, March 20, 2011

ArcGIS Server SOE Batch Installation File

I am sure more and more GIS people are working on SOE now, especially after ESRI announced on 2011 Dev Summit that ADF was out and AGS local connection was out. However, it's not that easy to create a SOE, at least not easy for the first time.

To help people coming along, I posted the batch file I have been using to install or uninstall a SOE. Let me know what you think.

I am a newbie to blogging, surprisingly, still trying to figure out how to get the code displayed not plainly.

@echo off

rem The commandline utility of installing or uninstalling MapLegendRestSOE with ArcGIS Server 10

set SOE_INSTALL=C:\Proj\AGS_SOE\Legend
set AGS_COMMOM="c:\Program Files\Common Files\ArcGIS\bin"
set WIN_DOTNET="%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727"

if "%1" == "" goto install
if not "%2" == "" goto usage
if /i %1 == install     goto install
if /i %1 == uninstall     goto uninstall
goto usage

%WIN_DOTNET%\regasm %SOE_INSTALL%\MapLegendRestSOE.dll /codebase
%AGS_COMMOM%\ESRIRegAsm.exe %SOE_INSTALL%\MapLegendRestSOE.ArcCatalog.dll /p:Desktop /s
echo MapLegendSOE is installed successfully
goto :eof

%SOE_INSTALL%\RegisterMapLegendRestSOE.exe /unregister
%AGS_COMMOM%\ESRIRegAsm.exe %SOE_INSTALL%\MapLegendRestSOE.ArcCatalog.dll /p:Desktop /u /s
%WIN_DOTNET%\regasm /unregister %SOE_INSTALL%\MapLegendRestSOE.dll
echo MapLegendSOE is uninstalled successfully
goto :eof

echo Error in script usage. The correct usage is:
echo     %0 [option]
echo where [option] is: install ^| uninstall
echo For example:
echo     %0 install

goto :eof