July 20, 2010

Mapguide 2011 Javascript error ‘OpenLayers.Lang’ is null or not an object

Filed under: Mapguide — Tags: , — Darrin Maidlow @ 10:33 pm

We’ve finally moved Mapguide Enterprise support back up the list of priorities for =)  The ability to add Google, Yahoo, and Bing data into the map with OpenLayers is very compelling.  So I’ve spent a little time (actually kind of a lot of time)  in the past little bit trying to get my Mapguide development environment setup.   To avoid cross site scripting (xss) errors when developing on my workstation I needed to install the web tier locally.   After muchos problems with license servers and the likes I came across an annoying javascript error whenever I would load a using  the local web tier:

   1: Line: 2
   2: Char: 2498
   3: Error: 'OpenLayers.Lang' is null or not an object
   4: Code: 0

Loading the web tier on the Mapguide server worked fine.  Very odd.  I ended up doing a file comparison between the two web tiers and noticed the only significant difference was this in the web.config:

   1: <staticContent>
   2:     <mimeMap fileExtension=".json" mimeType="application/json" />
   3: </staticContent>

Adding this tag to IIS 7 on Vista resulted in an error, the tag must be something new in IIS 7.5.  However, after manually adding the mime type mapping to the server – my flexible layout now loads perfectly on the local Vista web tier.SNAGHTML15f08bbe

This mime type mapping can be added on either the virtual directory, or the server level.  I chos to add it to the server.  Either way, to add it select the appropriate level in IIS manager.  In the right hand window double click “Mime Types”.  Click Add and you can enter the .json extension and the mime type.  Once this is added, Vista/IIS7 was now properly serving out flexible layers



  1. [...] 3 week gap here, wherein I had a hell of a time getting MGE 2011 installed and properly licensed so that I could actually test this newly created code, oh and I also went on vacation for a few [...]

    Pingback by Creating .NET objects for Mapguide Enterprise 2011 « Geospecialling — July 24, 2010 @ 11:15 pm

  2. I just signed up to your blogs rss feed. Will you post more on this subject?

    Comment by badmash — October 22, 2010 @ 11:36 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

Switch to our mobile site