Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken reference to OpenLayers map object. Currently the following... #126

Closed
wants to merge 1 commit into from

Conversation

chrismayer
Copy link

... error is thrown: "Uncaught TypeError: Cannot call method 'register' of undefined" when this plugin is being initialized inside a viewer.

…ing error is thrown: "Uncaught TypeError: Cannot call method 'register' of undefined" when this plugin is being initialized inside a viewer.
@chrismayer
Copy link
Author

This change is based on the logic of accessing the OpenLayers map object here: https://github.com/opengeo/gxp/blob/master/src/script/plugins/LayerSource.js#L82

@bartvde
Copy link
Contributor

bartvde commented Mar 14, 2012

@chrismayer how can I reproduce this issue? How are you using it?
This plugin should be in mapPlugins and not in the tools section.

@chrismayer
Copy link
Author

@bartvde I use this within a gxp.Viewer instance inside the tools section, like this:

new gxp.Viewer ({ 

    ...

    tools : [{
            ptype: 'gxp_loadingindicator',
            loadingMapMessage: 'loading...'
        }],

    ...

});

which seems to be wrong according to your comment. What is the best way to find the right way? Did I miss a hint here in the API docs http://gxp.opengeo.org/master/doc/lib/plugins/LoadingIndicator.html ?

@bartvde
Copy link
Contributor

bartvde commented Mar 14, 2012

To be honest, it's only mentioned if you look at mapPlugins in the Viewer api docs:

http://gxp.opengeo.org/master/doc/lib/widgets/Viewer.html

mapPlugins
Array(Ext.util.Observable) Any plugins to be added to the map panel, e.g. gxp.plugins.LoadingIndicator.

Does it work for you this way?

@chrismayer
Copy link
Author

Now it compiles, but unfortunately the loading mask does not appear (without error). But this seems to be a different problem.

Maybe mentioning vice versa in the API docs would be useful to avoid the error I did.
So in http://gxp.opengeo.org/master/doc/lib/plugins/LoadingIndicator.html we could say something like "could be used in the 'mapPlugins' array".

If the core developers would give a convention for this (howto tag this for API docs) the docs could be improved by other developers too and the API docs would improve.

What do you think?

Thanks,
Chris

@chrismayer chrismayer closed this May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants