FOSS4G 2011 Presentation: Mixing It Up with OpenLayers, ArcGIS Server and JavaScript Widgets

September 23rd, 2011 No comments

We recently had the opportunity to present at FOSS4G 2011, the premiere international conference for open source geospatial software that was held in Denver this year (right across the street).  There were over 900 attendees and it was an excellent conference.

Our presentation focused on the idea of using open source software with closed source software and the presentation highlights the success we have had in using this hybrid approach.

After we gave our presentation, I was approached by an audience member that was the original author of the AgsJSAdapter that we talked about in our presentation.

We have made several changes to the adapter to remove the dependency on the ESRI ArcGIS Server JavaScript API and we’ll try to get the changes posted back for others to use.

GIS in the Rockies 2011

I have also uploaded a previous presentation that we gave at GIS in the Rockies 2011 that goes more into the mechanics of building maps as distributed JavaScript widgets.

Presentation – Building Distributed JavaScript Map Widgets

March 30th, 2011 3 comments

I gave a lightning talk at the ESRI Denver Dev Meetup yesterday evening on building distributed JavaScript map widgets.

The presentation provided an overview of some techniques, technical considerations, and benefits of using JavaScript widgets (as opposed to iframe widgets).

This was my first attempt at a lighting talk.. seven minutes sure go by fast!

Here are the slides:

Displaying Google Fusion Tables Map Tiles in OpenLayers

March 25th, 2011 No comments

Just came across a nice jsFiddle example showing how to display map tiles from Google Fusion Tables in OpenLayers.

Full example at: http://jsfiddle.net/UAxun/155/

Using Google Closure Compiler with OpenLayers

February 8th, 2011 No comments

We have integrated Google Closure Compiler into our OpenLayers build scripts and we are getting 22% more compression over jsmin when using the Closure Compiler SIMPLE_OPTIMIZATIONS compilation level.

OpenLayers is not written to support the ADVANCED_OPTIMIZATIONS level but works great with SIMPLE_OPTIMIZATIONS.

We are calling the Closure Compiler Service API from a Python script and we are running OpenLayers through jsmin first to reduce the request size before sending the request up to Google.

Note that the service API only supports requests up to 1000KB so you will need to customize your OpenLayers build to remove the parts you don’t use first.  In our case we were able to reduce the before-minified size by almost 60%.

Here is the python module we are calling from the main OpenLayers build script:

#!/usr/bin/python
import httplib, urllib, sys
from StringIO import StringIO

def compile(input):

    # Define the parameters for the POST request and encode them in
    # a URL-safe format.
    params = urllib.urlencode([
        ('js_code', input),
        ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),
        ('output_format', 'text'),
        ('output_info', 'compiled_code'),
      ])

    # Always use the following value for the Content-type header.
    headers = { "Content-type": "application/x-www-form-urlencoded" }
    conn = httplib.HTTPConnection('closure-compiler.appspot.com')
    conn.request('POST', '/compile', params, headers)
    response = conn.getresponse()
    data = response.read()
    conn.close
    return data

Using TFS 2010 Team Build Web Deployment with IIS 6

December 13th, 2010 1 comment

We recently attempted to get a Visual Studio 2010 web project set up for automatic deployment using Team Foundation Server 2010. There are plenty of blog posts outlining the setup procedure when deploying to IIS 7 but there is minimal documentation on deploying to IIS 6.

After digging we ended up with the following MSBuild parameters which worked on our dev laptops using msbuild.exe but didn’t work on our Team Build server:

/p:DeployOnBuild=true
/p:DeployTarget=MSDeployPublish
/p:MSDeployPublishMethod=RemoteAgent
/p:DeployIisAppPath="Default Web Site/(directory>)"
/p:MsDeployServiceUrl="http://(webserver)/msdeployagentservice"
/p:username=****
/p:password=****

When running a Team Build, the build failed with the following error:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\
Microsoft.Web.Publishing.targets (1657): The "MapUriToIisWebServer" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
at Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.get_IisMajorVersion()
at Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost,
TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket,
TaskExecutionMode howToExecuteTask, Boolean& taskResult)

When we ran msbuild.exe on the project locally using the same parameters we noticed the following warning in the output (in bright yellow):

Validating Web Deploy package/publish related properties...
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3436,5): warning : Setting both property values of DeployAsIisApp and IncludeIisSettingsOnPublish to true is not recommended, as IncludeIisSettingsOnPublish is a superset of DeployAsIisApp [(projectfile).csproj]

Our solution for getting the deployment working with IIS 6 was simply to append the following additional MS Build parameter:

/p:IncludeIisSettingsOnPublish=false

Control OpenLayers FramedCloud Popup Position

October 20th, 2010 7 comments

By default, the OpenLayers FramedCloud popup will open in one of four positions (top-left, bottom-left, top-right, bottom-right) to best fit the popup on the screen.  

I wanted to find a way to force the popup to always open to the top-right but I couldn’t find anything in the API that directly allows you to set this.

The fixedRelativePosition attribute allows you to specify that a custom popup you have created only opens in one position but setting this property to false on the out-of-the-box FramedCloud popup doesn’t have any effect.

The solution I found was to override the calculateRelativePostion method that is inherited from the OpenLayers.Popup.Anchored class as follows:

// Create the popup
var popup = new OpenLayers.Popup.FramedCloud("popup",
    feature.geometry.getBounds().getCenterLonLat(),
    new OpenLayers.Size(100, 100),
    "popup contents",
    null, true, onPopupClose);

// Force the popup to always open to the top-right
popup.calculateRelativePosition = function () {
    return 'tr';
}

The FramedCloud popup supports panMapIfOutOfView so the map will automatically pan to ensure that popup is displayed within the extent of the view frame.

The Geospatial Revolution Project

September 29th, 2010 No comments

The Geospatial Revolution Project is publishing a series of video episodes that provide an excellent overview of digital mapping and location-based technologies and their impact on the way we interact with our world.

The first episode is currently online and future episodes will be posted over the next 6 months.

More info at http://geospatialrevolution.psu.edu/.

Categories: GIS Tags: , ,

Seeking a GIS Developer to Join Our Team

September 13th, 2010 No comments

This position has been filled.

My development team is currently looking for a mid-level GIS Developer.

We are looking for someone that has experience in ArcObjects and ArcGIS Server development and administration but that is also interested in moving more into “Web 2.0″ GIS application development (RESTful services, ArcGIS Server JavaScript API, Dojo, ASP.NET MVC, WCF etc.).

Our team develops primarily in C# and makes extensive use of the Visual Studio Team System. We develop software using the Scrum software development framework, allowing us to be agile and to work closely with our customers.  We have a team room available to us that provides an excellent team collaboration space.

We value high quality software and we use continuous integration (automated builds, automated unit testing, static code analysis and automated test deployments) to allow us to develop software rapidly.

If you think you have the skills and you are interested in shaping the future of Denver’s GIS program apply online at http://www.denvergov.org/jobs.

Note: The position is listed as ‘Associate GIS Developer’.