If you get one of the following in IE or Firefox:

  • a is null or not an object
  • oa is null or not an object
  • ‘J’ is null or not an object

The error is exactly what it says – you are probably adding or removing a null overlay.

The Fix for this is to do an if statement to check if your overlay is null before you try to add or remove it =

if ( myOverlay != null )
	map.removeOverlay(myOverlay);
  • TwitThis
  • Yahoo! Buzz
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • MySpace
  • Google
  • Blogosphere News
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Technorati

Previous Post: Backing up a large Subversion repository to S3
Next Post: Syntax Highlighter and Code Prettifier Plugin for Wordpress

4 Responses to “Google Maps Error: is null or not an object”

  1. TJ on April 23rd, 2009 12:38 pm

    You’re so smart.

  2. TJ on April 23rd, 2009 9:24 pm

    TJ is an idiot

  3. Dijesh Mathew on April 29th, 2009 2:43 pm

    I did the same , but not working

  4. Vijesh on April 29th, 2009 2:50 pm

    Dijesh: check for null values. If you are adding overlay, points or anything else.

Leave a Reply