Building the JavaScript for the Mobile Campus Map

In order to reduce file size and to optimize the code, the JavaScript used in the mobile versions of the campus map is compiled using Google’s Closure Compiler. The code is a combination of several different source files compiled into the final file. The compiler requires any references to libraries or functions outside of the source files to be defined in extern files.

The main version is compiled from the following source files:

Opera Mobile Support

Opera Mobile is not an officially supported browser for the Google Maps V3 JavaScript API. However, most of the basic functionality of the map works normally. The major exceptions related to the mobile campus map are the inability to pan the map by dragging and polylines.

In order to overcome these shortcomings, two additional source libraries are included in the opera version of the script:

  • canvaspolylines.js – uses the HTML 5 canvas tag to provide basic polyline support in Operanot needed with KmlLayers
  • zoompancontrol.js – adds a small zoom and pan control to compensate for the inability to drag the map

Output Wrapping

The compiled output is wrapped in an anonymous function to prevent the global namespace from being polluted.

Update: 3/31/2010

I’ve now also compiled the main campus map with Closure Compiler. The original source files are:

About Chad Killingsworth

Chad Killingsworth is the assistant director and technical lead for the office of web & new media at Missouri State University.
Follow me on twitter
This entry was posted in Technical, Web and New Media and tagged , , , . Bookmark the permalink.

3 Responses to Building the JavaScript for the Mobile Campus Map

  1. Pingback: Missouri State’s Great Interactive Map: A Look Under the Hood

  2. talkpc says:

    Well
    it was a huge problem to not have this. Luckily, I was able to find tileoverlay.js by Chad Killingsworth, which solved this problem for

  3. website info says:

    Great
    Building the JavaScript for the Mobile Campus Map