[I'm classifying this as a bug because I think with sufficient documentation for the install, I could avoid it.]
Mapbuilder tells me "Loading Mapbuilder program," and I get the animation that comes from this source:
/sites/all/modules/mapbuilder/mapbuilder-src/lib/skin/default/images/Loading.gif
Here are my paths from config.xml, where I changed the values to the *-src directory, and the path to the widget XML file to where that file is actually located:
/public_html/sites/all/modules/mapbuilder/demo/demisWorldMap.xml
/public_html/sites/all/modules/mapbuilder/mapbuilder-src/lib/skin/default
/en/widgetText.xml
Here is the map tag in a blog post. (The behavior is the same whether the width/height/bbox attributes are present or not):
mapbuilder/config/6
The input format of the blog post is to mapbuilder.
And node 6 is as follows: (I know mapbuilder is looking at this, because an incorrect NID throws an error):
1. Title: This is a map configuration node
2. Model URL: /sites/all/modules/mapbuilder/demo/demisWorldMap.xml [Doesn't work without leading slash either]
The mapbuilder input format has been created. When I use these weights:
-10 expand mapbuilder tags
-9 HTML filter
10 Line break
My blog post with embedded map prints out: "This page requires Javascript to be enabled" and "Loading Mapbuilder program."
With this order I'm back to the perpetual load:
-10 HTML filter
-9 expand mapbuilder tags
10 Line break
What must I do, to get a map to load?
Drupal 5.1, PHP 5.2.1, FireFox 2.0.0.1
'./configure' '--enable-pic' '--with-apxs=/usr/local/apache/bin/apxs' '--with-libdir=lib64' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-zlib'
P.S. JavaScript is enabled in my browser -- I get the little dragger bars in the post boxes, for instance.
However, I get this error (and others that I think cascade from it):
Error: this.node has no properties
Source File: http://www.universalpantograph.com/sites/all/modules/mapbuilder/mapbuild...
Line: 85
Help! I know nothing of JavaScript!
Comments
Comment #1
lambert-1 commentedIt looks like I've got a configuration with mapbuilder's JavaScript. From FF's error log:
Error: this.node has no properties.
Source File: ... all/modules/mapbuilder/mapbuilder-src/lib/widget/MapContainerBase.js
So, the good news is, the mapbuilder is finding the files. But it's not understanding them.
1. My $base_url is set in settings.php
2. Per the main Community Mapbuilder site, text/xml is a mime type:
# less mime.types |grep xml
application/xhtml+xml xhtml xht
application/xslt+xml xslt
application/xml xml xsl
application/xml-dtd dtd
application/xml-external-parsed-entity
text/xml
text/xml-external-parsed-entity
That's all I know to look for. What am I doing wrong?
PHP 5.2.1, curl and DOM installed, Drupal 5.1
Comment #2
jpulles commentedAssuming that in your browser source, you see that Mapbuilder loads a series of javascript files, it must be that your settings are ok.
I'm not happy how the mapbuilder module is performing under Drupal 5; sometimes the javascript loading returns errors such as you got. It improves when browser caching is enabled. At present I have no clue as to what causes this behaviour under drupal 5; drupal 4.x gives no problems.
Comment #3
jpulles commentedIn my case, i often got the javascript error "Extent is not defined". The problem seems to be that not all javascript files are loaded in time. A workaround for this problem seemed a small addition to Mapbuilder.js, located in the lib folder of the Mapbuilder sources:
After this patch, the map showed each time, even with browser caching disabled.
I hope this may help you?
Comment #4
lambert-1 commentedopenwereld:
I have caching enabled under Drupal 5.1 (not "aggressive," but normal).
And I really hate to rip out Drupal 4.1 and revert to 4.7.*
Comment #5
lambert-1 commentedIt sounds like I don't need to rip out and re-install Mapbuilder -- since the JS files are being understood. (That is, they wouldn't be throwing errors if they weren't being read).
Thanks for the ideas on a JavaScript patch but I have some questions:
1. Are you using the 1.0.1 stable release for the patch and for your testing or (as the config.xml file suggests) the 1.5 alpha? (I used 1.0.1)
2. How did you choose those two files (sarissa and extent) to load? From the errors that were thrown on your installation?
3. Do you have any other suggestions for me to test that my installation is installed and set up properly? Not to trash the documentation again, but for a lot of this, I was hoping I guessed right...
I'll try this and post my results...
Comment #6
jpulles commented1) In general I use the stable 1.0.1 version of mapbuilder
2) I did not choose between Sarissa.js and Extent.js; the Extent.js file was added at the end of the list of javascript files which is already loaded by Mapbuilder in the MB_LOAD_CORE state. This one was added because of the javascript error ("Extent is not defined") and because the Extent.js file was the last file to load (as shown in the generated page source)
3) No more suggestions at this time. Javascript errors with Mapbuilder are often very difficult to solve. Sometimes you get javascript errors because the html doesn't contain the html elements which are referred to in the map config document.
Comment #7
lambert-1 commentedMy results:
I made the JavaScript change ("// ADDITION: make sure that Extent.js is loaded in time") and just got new errors of stuff that's not defined.
I'm going to rip out my installation and reinstall using the 1.5 alpha mapbuilder (since I surmise from your config.xml file, openwerel, that you are using that).
Comment #8
lambert-1 commentedopenwerel:
Javascript errors with Mapbuilder are often very difficult to solve. Sometimes you get javascript errors because the html doesn't contain the html elements which are referred to in the map config document
Huh? Couldn't you use XML schema to make sure undefine elements don't happen?
Comment #9
lambert-1 commentedOne more question, openwereld:
You write:
Could you include the generated page source, so I can see what the page ought to have? Thanks.
Comment #10
lambert-1 commentedAgain, complete failure, after re-installing everything with the 1.0.1 mapbuilder library, and the suggested patch.
1. Submitted config node with demo context node (13) as per http://drupal.org/node/112157
2. Submitted blog node with mapbuilder input format on and the following HTML as per README.txt
3. All I get is the animated "Loading mapbuilder" gif and the following error:
The settings:
1. config.xml:
(The skinDir doesn't include "en," so I assume that's added automagically so the system can find widgetText.xml.)
2. admin/settings/mapbuilder:
Base: sites/all/modules/mapbuilder/mapbuilder-src/
Skin: sites/all/modules/mapbuilder/mapbuilder-src/lib/skin/default/
3. mapbuilder.module
<?PHP
// the path for contrib modules changes in drupal 5
if (!defined("VERSION") || floatval(VERSION) < 5) {
define("DEFAULT_MAPBUILDER_PATH", 'modules/mapbuilder/mapbuilder-src/');
} else {
define("DEFAULT_MAPBUILDER_PATH", 'sites/all/modules/mapbuilder/mapbuilder-src/');
}
?>
4. PHP5 with curl and xml. Drupal 5.1. FF 2.0.0.1. Here's the relevant HTML from the page build:
Thanks for any help you can give.
Comment #11
jpulles commentedWhen looking at your page http://www.universalpantograph.com/node/15 in IE7 I got a javascript error for a DIV with ID="locatorContainer". This one is present in the config (see http://www.universalpantograph.com/mapbuilder/config/15) and will show an overview map if present. If you look for it in the mapbuilder.module file (or config.inc.php) you'll find a block in the function ..generate_config.. which is (true) by default. What happens if you change it to (false) so that it will not be written to the generated config file.
Comment #12
jpulles commentedI just got good results by changing the order of loading the drupal include files (jquery.js and drupal.js) and mapbuilder.js. If mapbuilder.js is loaded before these, the maps display consistently!
At this time, I don't want to rush committing this code to cvs, because there were some large changes in trying to support php4. A commit should follow this week.
In case you can't wait to try: the following code should replace the corresponding part in the mapbuilder_set_html_head function in mapbuilder.module...
This should have the effect that in the page source, mapbuilder.js is included before jquery/drupal.js.
Comment #13
lambert-1 commentedAgain, failure with FF 2.0.0.1. I made the change to the JavaScript. Here is what the HTML for the map node looks like:
There is no DIV with id=locatorContainer.
And here is the block for mapbuilder_generate_config:
What is the line I am supposed to patch, and how do I patch it?
Again, here is the error I am still getting in FF -- it's the same.
I do get HTML errors, but not the ones that you mention.
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.universalpa...
Could you point me to a working installation, or post the HTML? Maybe that will help me find out what's going on. I keep thinking there's some JS config issue I'm missing (baseDir) but Drupal JS is supposed to work out of the box...
Good luck with PHP4 XML functions; they're a mess, as I'm sure you're finding out...
Comment #14
jpulles commentedThe DIV with id="locatorContainer" can be made available by enabling the Map Overview block. Or you can put it yourself in your page body, if your filter permits
Comment #15
jpulles commentedA demo page can be found at http://testversie.geodan.nl/demo/?q=node/1.
Comment #16
jpulles commentedTitle changed to reflect javascript errors which are occurring in the loaded community mapbuilder code. The picture with 'loading mapbuilder program' is an animated gif and thus keeps on repeating itself.
Code has been committed that improves the loading order of javascript files under drupal 5.0.
Comment #17
lambert-1 commentedYes, this fix worked for me. Thank you. (I revised the installation and testing documentation that I wrote accordingly.)
Comment #18
(not verified) commented