Hi!
I'm trying to use the Sharemaps plugin to create and edit the user maps. Cannot to resolve the issue..
Error: Module name "sharemaps_drawonmaps_elgg_js" has not been loaded yet for context: _ https://requirejs.org/docs/errors.html#notloaded
This is looks strange for me but looks like plugin depends froms the self?
drawonmaps_elgg.js
define(function (require) {var elgg = require('elgg');var $ = require('jquery');require('sharemaps_googleapis_js');require('sharemaps_prettify_js');require('sharemaps_drawonmaps_elgg_js'); -- This is the error place
views.php
<?php/*** Elgg ShareMaps plugin* @package sharemaps*/return ['default' => ['sharemaps_drawonmaps_elgg_js.js' => __DIR__ . '/vendors/drawonmaps/drawonmaps_elgg.js','sharemaps_gmaps_js.js' => __DIR__ . '/vendors/drawonmaps/gmaps.js','sharemaps_prettify_js.js' => __DIR__ . '/vendors/drawonmaps/prettify.js','sharemapsps_api/graphics/' => __DIR__ . '/graphics',],];
Possibly the issue exist from timeout or form loop in the required info?
Please any ideas?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
Did you shim your JS by setting
exports
anddeps
inelgg_define_js
ininit{}
of yourstart.php
?Hi RvR!
Yes, this is in the start.php of a module
Try this:
And another trick is:
Hi RvR!
Thank you!
Tried both solutions, but unfortunately without results the first one lead to the same Loading timeout but the second one shows:
the views.php:
start.php
drawonmaps_elgg_js.js there is also drawonmaps_elgg.js
But the error is:
In above reply:
use:
Or change name of your JS on shortname aka drawonmaps.js.
In views don't use .js at the end of your defined JS:
In start.php use only defined JS, eg:
Then require it:
Use browser's console for checking errors.
Run 'Flush the caches' always after changings
RvR, thank you very much for your help !
Yes I've Flush the caches in the admin site console.
After trying to implement short names without JS at the defined JS - received many not found errors. These changes are very huge as they are related to many files. I suppose the long name to defined was used as naming convention of the plugin author. Also in the docs for view's I founded that .js exist in the definition http://learn.elgg.org/en/stable/guides/javascript.html#setting-the-url-of-a-module
So I've reinstalled the plugin from the git. Possibly the first error is easy to resolve.
The error looks like this:
in the views/default/sharemaps/drawmon.js there are:
in the vendors/drawonmaps/drawonmaps_elgg.js there are
and in the start.php
The maps was showed once after loading but after refresh we have an error above.
Possible I should open the new ticket for this. Sorry..
That's right. I've suggested some of solutions only.
Recommend ask / open issue on Sharemap's repo also.
BTW, you can find more plugins related with GMaps API there ;)
Use /vendors directory for 3-rd party JS libs only.
If your drawonmaps_elgg.js is defined (used RequireJS) already then move it on:
Then use elgg_require_js(); on the view/page which you need this JS.
In your case is:
Good example for using JS libs which requires API's keys is reCaptcha
- Previous
- 1
- 2
- Next
You must log in to post replies.