ArcGIS API for Javascript and CEF

With our latest project (Asset Editor) we came up with a number of challenges to overcome in order to deliver a successful application.  Probably the biggest challenge was the integration of a live map using the client’s ArcGIS.

Normally the implementation of a view of ArcGIS in Chrome or IE is simple given the excellent API supplied by Esri, however we needed to have this view within an application rather than a web browser.  In the past we used Microsoft’s WebBrowser control, but given the restrictions in place on the client’s device and the restrictions on the API for ArcGIS, we needed to look at another solution.  To achieve this we looked at CEF and CefSharp which can be used without installation and comes with a fantastic  set of DevTools amongst other benefits (speed etc…).  Implementation of CEF wasn’t necessarily straight forward, but after creating some test apps to prove that the concept would work, we were able to create the same framework that we would normally have created using the old WebBrowser control.  The support for Javascript integration is great and really easy to implement and allowed us to nicely integrate the control into our code and provide the necessary couplings between web browser, ArcGIS and the back end.



Corridor Tracker

During some work on a new project for a client we needed to be able to define boundaries for physical map areas (e.g. rail corridors).  Given that the project was for rail vehicles, there was only certain areas on the map where the vehicle could enter and exit these boundaries.

We used Google Earth to define these boundaries using polygons that covered the boundary positions for both entry and exit (separate ones for each).  The polygons were structured in Google Earth to provide a simple hierarchy that would provide extra information where needed (e.g. corridor name, owner, operator etc…).  The polygons were then exported to the usual KML file.  Given that the KML file is a standard and the format is in XML we then simply imported the file into our project to generate data type classes that could read in the file.  Understanding of course that a change to the KML specification and therefore a potential change to the format would break the import!!!  This particular case would be handled externally to these generated classes.

With all of this in place we were able to easily provide the client with a configurable definition of their rail corridors that could be read in and subsequently viewed in the applications Google Maps window and processed according to the vehicles current position.