Friday, August 27, 2010

Public Facing Road Construction Projects Web Map

I just updated my only real public facing JavaScript app. This app (which is embedded in the city's web site) shows all of the road construction projects in the city along with relevant information that appears in a custom info window (ESRI dev sample) when you hover over the graphics.

I've also added the UDOT traffic cameras in this latest update. I was able to determine the id number and URL for each of the camera images using the UDOT CommterLink website. With permission from UDOT, I used this information to build my own map service showing the cameras.

What do you think? Anyone have any suggestions on making it better?

Thursday, August 26, 2010

How To Get an ArcGIS Add-in Dockable Window

It wasn't as easy as it first appeared. Here is a quote from an ESRI staff member that replied to my plea for help in the forums:
DockableWindow is a bit tricky here since it is implemented by two classes - 1) the UI part is the designer surface derived from controls and 2) the non-UI part is the class actually inherits from DockableWindow base class. 
FromID can only handle types derived from base classes declared in ESRI.ArcGIS.Desktop.AddIns.dll. You have to pass in the type that inherits DockableWindow, which is the inner class of the designer window itself if you are using the Add-in Wizard.
If you go to the xml declaration of the dockable window, you will see the class attribute is set to “DockableWindow1+AddinImpl”. You have to pass this type to get the dockablewindow implementation class first, then you have to expose a property there get a hold of the UI window.
While I won't pretend to understand stand it perfectly yet, I did come up with a solution that works well.

First, I added added a property called "UI" to the innerclass "AddinImpl" within my dockable window class that points to the dockable window class (why isn't this part of the template?):

/// <summary> /// Implementation class of the dockable window add-in. It is responsible for /// creating and disposing the user interface class of the dockable window. /// </summary> public class AddinImpl : ESRI.ArcGIS.Desktop.AddIns.DockableWindow { private DockableWindow1 m_windowUI; // this property is what I added - the rest was generated by the template internal DockableWindow1 UI { get { return m_windowUI; } } public AddinImpl() { } protected override IntPtr OnCreateChild() { m_windowUI = new DockableWindow1(this.Hook); return m_windowUI.Handle; } protected override void Dispose(bool disposing) { if (m_windowUI != null) m_windowUI.Dispose(disposing); base.Dispose(disposing); } }

Then to get the dockable window from another class it was just a few lines:

// get reference to dockable window DockableWindow1.AddinImpl winImpl = AddIn.FromID<DockableWindow1.AddinImpl>(ThisAddIn.IDs.DockableWindow1); DockableWindow1 dockWin = winImpl.UI; // or you could just do this DockableWindow1 dockWin = AddIn.FromID<DockableWindow1.AddinImpl>(ThisAddIn.IDs.DockableWindow1).UI;

I spent hours trying to figure this out. Hopefully this will save you the head-ache. Anyone else out there using Add-ins yet?

Friday, August 20, 2010

Go Web Mapping API's!

Two interesting quotes from the Deprecation Plans document just released from ESRI:
ArcGIS Server 10.0 is the last ArcGIS Server release with support for local connections from Web ADF applications. The 10.1 Web ADF applications will only support local connections to Server versions prior to 10.1. We recommend developers using local connections for accessing fine-grained ArcObjects migrate their business logic to Server Object Extensions. For Web ADF based editing applications (all of which use Local connections), we urge users to look at alternative web editing tools based in the ArcGIS Web Mapping APIs.
ArcGIS Server 10.1 will be the last planned release for the ArcGIS Server Web ADFs (Application Developer Framework) for both Microsoft .NET and Java. ESRI will continue supporting the Web ADFs during the 10.1 release cycle but only fixes to critical issues will be addressed. No new functionality or enhancement requests will be addressed for the Web ADFs. Web application developers are encouraged to move to a web services based pattern with the ArcGIS Web Mapping APIs for JavaScript, Flex, or Silverlight.
Looks like all of you Web ADF people have only a few years left to transition to the future.

Thursday, August 12, 2010

Local GIS: Utah County Parcel Map

The Utah County Parcel Map JavaScript application is a great, local example of the ESRI JavaScript API. You can easily recognize the use of Dojo in the layout and controls in the pane on the left. It's a simple and clean application that's easy to use.

I also like the use of the Local Government Infrastructure Base Map Template. I think that I'm going to take a look at this template to see if it can help my ugly base map service.

Dave H. and Darin S. from Utah County GIS are raising the bar!

Tuesday, August 3, 2010

Another Reason to Love the JavaScript API

ArcGIS Server Blog : Build applications for iOS using the ArcGIS API for Javascript

With a slight modification to the API reference (add "compact") you can build web maps optimized for Safari on the iPhone with built in goodies like flick to pan and pinch to zoom. I've already noticed it once in the wild that's even using Safari's Geolocation API.

Anyone giving this a try?