Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hi,
I followed the official tutorial explaining how to create personal plugin with openGeo client sdk but unfortunately I couldn't perform that task.
In the beggining, i "copy/ past" the code as it mentioned in the tutorial but my browser told me that gxp is not defined after that i make changes as follows:

/**
*
* @require plugins/Tool.js
*/

/** api: (extends)
*  plugins/Tool.js
*/

Ext.namespace("gxp.plugins");
//Ext.ns("carta.plugins");

gxp.plugins.DrawBox = Ext.extend(gxp.plugins.Tool, {
ptype: "gxp_drawbox",
addActions: function(){
    return gxp.plugins.DrawBox.superclass.addActions.apply(this, [{
        text: "Draw box"
    }]);
}
});

Ext.preg(gxp.plugins.DrawBox.prototype.ptype, gxp.plugins.DrawBox);  
#

Then, when I examine the code with chrome I receive this eroor :

Uncaught TypeError: Cannot read property 'prototype' of undefined ext-base.js:7
Ext.apply.extend ext-base.js:7
(anonymous function)

Do you have any hints about resolving this problem?
Thanks.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The SDK is not very forgiving when parsing the @require directives. Make sure that each @require line starts with blank-star-blank, and not just with star-blank.

share|improve this answer
    
oh great !!! I should start with blank-start-blank thank you the problem is resolved –  jabrane Jun 4 '13 at 4:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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