In my Openlayers app, since the base map projection is not epsg900913 or 4326, I need to include proj4js in order to use geolocation feature. but I got such an error notice:

 GET http://svn.osgeo.org/metacrs/proj4js/trunk/lib/projCode/null.js 404 (Not Found)

I am wondering how come this null.js is needed here. the funny thing is I can't find this file from proj4js lib files..

anybody can help me out?


<!DOCTYPE html> 
<link rel="stylesheet" href="theme/default/style.css" type="text/css"> 
<link rel="stylesheet" href="style.css" type="text/css"> 
<script type="text/javascript" src="http://svn.osgeo.org/metacrs/proj4js/trunk/lib/proj4js.js"></script>
<script src="http://openlayers.org/dev/OpenLayers.js"></script> 

    <div id="map" class="smallmap"></div> 
<script  type="text/javascript">
    var map = new OpenLayers.Map({
    div: "map",
    projection: new OpenLayers.Projection("EPSG:26912"),
    layers: [
        new OpenLayers.Layer("",{isBaseLayer: true}),
        new OpenLayers.Layer.Vector("KML", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "test.kml",
                format: new OpenLayers.Format.KML({
                    extractStyles: true, 
                    extractAttributes: true,
                    maxDepth: 2

  • Try to reformulate the title to a question, for example "How do I include proj4js in openlayers?" Commented Aug 12, 2011 at 6:44

3 Answers 3


After looking at your code it seems the error is in the definition of EPSG26912 where a colon is missing. Try the changes on local copy and then report them to the developers. You should never link to code from SVN trunk, anyway because of both performance and stability issues. Instead use a stable version of proj4js or a local checkout.

  • Hi thanks for your reply. i attached the code, i don't know why i got that null.js 404-not-found error after including proj4js.js header file.
    – Simon
    Commented Aug 13, 2011 at 3:54
  • cool.. forgive my carelessness..
    – Simon
    Commented Aug 13, 2011 at 17:23

should be

projection: new OpenLayers.Projection("EPSG:26912");

Add this before:

Proj4js.defs["EPSG:26912"] = "+proj=utm +zone=12 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";
  • thanks for this notice. however, it doesn't work.
    – Simon
    Commented Aug 13, 2011 at 17:15

This isn't an answer yet, but hopefully we'll be able to work it to there. I've got a pretty simple projection up here which should allow us to test the answer proposed by @ilia and figure out something which we can all get to work.

I've put essentially the complex example of Proj4JS from http://openlayers.org/dev/examples/using-proj4js.html here: http://jsfiddle.net/cpwqA/

What's the simplest that we can make this? I've tried to do one up here with a basic projection: http://jsfiddle.net/5jRX9/

It doesn't work, but much of the interesting stuff is in the Manage resources section in the sidebar.

The defaults I'm pulling in from: http://spatialreference.org/ref/epsg/26912/proj4js/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.