[OpenLayers-Dev] Runtime error in IE with standard version of openlayers and OSM

Christopher Schmidt crschmidt at metacarta.com
Thu Mar 27 07:40:15 EDT 2008


On Wed, Mar 26, 2008 at 11:58:30PM +0000, Andy Deakin wrote:
> Hi Guys,
> 
> I have been using the OSM and OpenLayers 
> (http://openlayers.org/api/OpenLayers.js) maps for a while now in 
> firefox, but when I view the site in IE (6 or 7, same problem) I get the 
> following error:
> 
> A Runtime Error has occured....
> Line 488
> Error: 'undefined' is null or is not an object

I'm guesing that you have an extra ',' at the end of an array somewhere.
This usually means that IE is looping over an array like:

 ['a', 'b', ]

and treating the final element as an 'undefined' rather than ignoring it
like some other browsers do.

I do not expect that this is an OpenLayers bug: To figure out if it is,
you'd probably need to install a Microsoft Script Debugging tool and
look at the actual trace to see where the code is failing.


> On a slightly different note, I have linestrings and other vector items 
> on a map, which disappear at zoomlevel 13, and can't seem to get them to 
> stay around for zoom levels 14,15 or 16. Any suggestions?

Set a numZoomLevels: 25 optino on the vector layer: My guess is that
your baseLayer defines a different set of resolutions, etc. than your
map does, which means that your vector layer is going out of its
available scale range. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list