TypeError $gameMap.mapID() is not a function

I am progressing through scripting tutorials and have run into the following error:

Error1.png


The following is the code I wish to run:
Code:
//=====================================================================
//Title_Modifier.js
//=====================================================================
/*:
*
* @plugindesc This is my first plugin.
*
* @author Alias72
*
* @param Outline_Width
* @disc Width of title outline
* @default 8
*
* @param Outline_Color
* @disc Color of title outline
* @default black
*
* @param Title_Font_Size
* @disc Size of title font
* @default 72
*
* @param Exclusion_Maps
* @disc Maps where player may not enter menu
* @default 0,1
*
* @ Help
*
* This is the help file
*
*/

(function() {

    var parameters = PluginManager.parameters('Title_Modifier');
    var MyColor = String(parameters['Outline_Color']);
    var MyWidth = Number(parameters['Outline_Width']);
    var MyFontSize = Number(parameters['Title_Font_Size']);

    Scene_Title.prototype.drawGameTitle = function() {
        var x = 20;
        var y = Graphics.height / 4;
        var maxWidth = Graphics.width - x * 2;
        var text = $dataSystem.gameTitle;
        this._gameTitleSprite.bitmap.outlineColor = MyColor;
        this._gameTitleSprite.bitmap.outlineWidth = MyWidth;
        this._gameTitleSprite.bitmap.fontSize = MyFontSize;
        this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');
    };
    
    var maps = String(parameters['Exclusion_Maps']).split(',');


    //var _Game_System_isMenuEnabled = Game_System.prototype.isMenuEnabled;

    //Game_System.prototype.isMenuEnabled = function() {
    //    return this._menuEnabled && maps.contains(String($gameMap.mapID()))==false;
    //};

    Game_Player.prototype.executeMove = function(direction) {
        this.moveStraight(direction);

        $gameMessage.add(String($gameMap.mapID()));
    };

})();

I would be incredibly grateful if someone could point out my error. Ideally I wish to create the aliased function that you see partially completed and commented out.

I've moved this thread to Learning Javascript. Thank you.


It might be a simple typo. Try $gameMap.mapId() instead of $gameMap.mapID().
This has fixed the issue. I did not see the d vs D in mapID. Thank you.
Glad I could help!

If your issue has been resolved, you can report your thread so it can be closed (because it has been solved). To report your thread, you can click on the "report" button just beside "Edit" at the bottom of any of your posts in this thread. You can simply write "solved" when it asks you for a reason.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/typeerror-gamemap-mapid-is-not-a-function.118518/