Yahoo Maps Error: YAHOO.util.CustomEvent is not a constructor

UPDATE: Fixed by Yahoo!

Seems like someone messed up! Yahoo Maps’ AJAX API is broken and Firebug prints this lovely message:

YAHOO.util.CustomEvent is not a constructor

A quick workaround is to grab the output from”

http://api.maps.yahoo.com/ajaxymap?v=(version)&appid=(apikey)

and look for

http://in.maps.yahoo.com/js

Replace that with:

http://in.maps.yahoo.com/v(version)/aj

Then replace your call to the AJAX API:

<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=(version)&appid=(apikey)"></script>

with the modified output from that script:

<script type="text/javascript">
var YAHOO=window.YAHOO||{};
YAHOO.namespace=function(_1){
    if(!_1||!_1.length){ return null; }
    var _2=_1.split(".");
    var _3=YAHOO;
    for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){
        _3[_2[i]]=_3[_2[i]]||{};
        _3=_3[_2[i]];
    }
    return _3;
};
YAHOO.namespace("util");
YAHOO.namespace("widget");
YAHOO.namespace("example");
var YMAPPID = "(apikey)";
function _ywjs(inc) { var o='<'+'script src="'+inc+'"'+' type="text/javascript"><'+'/script>'; document.write(o); }
_ywjs('http://in.maps.yahoo.com/v(version)/aj/y.js');
_ywjs('http://in.maps.yahoo.com/v(version)/aj/ymapapi.js?v=(full_version)');
_ywjs('http://in.maps.yahoo.com/v(version)/aj/ymic_4.js');
</script>

This is a temporary workaround, YAHOO! will probably fix this really soon!

PS: Remember to replace (apikey), (version) and (full_version) with the proper  values!

5 thoughts on “Yahoo Maps Error: YAHOO.util.CustomEvent is not a constructor

  1. we are using the in.maps.yahoo.com.lot of persons acess the site it closing the explore.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>