Chameleon    Home  |  Docs  |  Support  |  Bugs  |  CVS  |  Downloads 

MapTools.org

Technical Problems

FAQ Questions

  1. why am I getting: Warning: session_start(): Cannot send session cache limiter?
  2. Why does Mozilla/Firefox/Netscape status bar always say "Transferring data from ..."? Is it really transferring data?
  3. I'm getting MapServer errors about projection stuff, how do I fix it?
  4. If a select list overlaps the map image when opened, picking an option causes the map to navigate (according to the current tool). This only happens in IE ... what's happening and how can I fix it?

FAQ Answers

Q: why am I getting: Warning: session_start(): Cannot send session cache limiter?

A: deep in the Chameleon code, there is a call to a php function session_start(). The warning you are seeing is emitted if anything is output to the browser before this call. This includes anything, including blank space, that is output outside of php script tags () or inside (as an echo, print_r etc). It is, therefore, reasonably important to process the include( "path/to/chameleon.php" ); (which is what ultimately triggers the above function to be called) before anything else is output to the page. If you are using the sample applications, they should already be set up to do this. Essentially, this means that you need to have a php start tag at the top of your main page (i.e. sample_basic.phtml) like:

include( "/path/to/chameleon.php" );

Q: Why does Mozilla/Firefox/Netscape status bar always say "Transferring data from ..."? Is it really transferring data?

A: In FireFox (and all other mozilla-based browsers), there is a known issue with the status bar that occurs when you change an image element's source after the page has loaded, it will always say "Transferring data from". I cannot find the reference that described the problem right now, but there is really nothing that can be done about this except wait for a newer version of Mozilla that fixes this. It definitely isn't still transferring, however.

Q: I'm getting MapServer errors about projection stuff, how do I fix it?

A: Assuming you haven't just made a typo in defining your projections, you are probably seeing an error like:

MapServer Error: msProcessProjection(): no system list, errno: 2

This is normally a configuration problem and (in this case) means that proj is working but it can't find its configuration files. On windows, proj will expect its supporting files to be installed in c:\proj directory. In this directory should be a number of binary and text files, including the infamous 'epsg' file. It is possible that these files are in a 'nad' subdirectory. If you don't have c:\proj, then you need to get the proj4 package and unzip it on to you system. If you do have it, but it is installed somewhere else, you can correct this problem by setting an environment variable that is accessible to your web server user (in IIS use a system variable, for Apache you can use a SetEnv directive in httpd.conf) OR you can put the path right in your mapfile using the CONFIG directive:

CONFIG PROJ_LIB '/path/to/proj'
You may also experience problems with case-sensitivity. If you use:
PROJECTION
 "init=epsg:4326"
END

in your map file, the 'epsg' part of the definition is telling proj to use the 'epsg' database and look up code 4326. If you use EPSG:4326 on linux, and the file is 'epsg' then it will fail with an error message similar to the one above.

Q: If a select list overlaps the map image when opened, picking an option causes the map to navigate (according to the current tool). This only happens in IE ... what's happening and how can I fix it?

A: The problem has to do with something called 'event bubbling'. Prior to the fix mentioned in bug 138, Chameleon had a mouse move handler registered for the entire page (inefficient) and after this fix, the mouse move handler is only registered when you move over the map. This fixed a couple of problems, but not this one. IE still sees the mouse moving over the map and causes the Chameleon mouse handlers to get used.

The MapDHTML widget receives mouse-move and mouse-click events when have a select box that opens over the map image because not 'consumed' by the select box and are passed on to other objects in the page. Event objects can be prevented from bubbling quite easily, although the mechanism is different between browsers (of course!). There is one further complication, however. I can't remember which is which right now, but IE and Mozilla-based browsers propogate events in different ways. In one browser, the event is first passed to the object that it is targetted at, and then passed up the Document Object Model from parent object to parent object until it hits the 'document' object. The other browser does it the other way around, starting at the document object and passing it down through the hierarchy to the targetted element. I believe the problem is that IE does it the wrong way around and that attempting to cancel bubbling of the event in the 'onchange' handler of the select boxes will have no effect because the map handlers have already received the event. At least that is my recollection of the problem.

To test this, you can try adding something like:

<select ...="" onchange="if (window.event) { window.event.cancelBubble = true; } 
<rest of handler>"></select>

you may need to check that cancelBubble is the right property to set in IE because I don't have my reference books with me right now.

Assuming that doesn't work, the next hack to try (for version 2.0) would be to do something like:

<select ...="" onchange="document.forms0.NAV_INPUT_COORDINATES=<your code>" 
onfocus="gszLastNavCmd = document.forms0.NAV_CMD.value"
onblur="document.forms0.NAV_CMD.value = gszLastNavCmd"></select>

this works by fooling the MapDHTML widget to think that there is no active nav command in place when you actually click the list, so it is still doing its job but just not submitting the page. You'll also need to clear NAV_INPUT_COORDINATES because after you put back the nav_cmd in the onblur, if you click refresh, it will still zoom because all the values are there for it to zoom!

You would need to put this into every select box that overlaps the map when open.

In the 2.1 branch, I've started working on a global mechanism for widgets to indicate if they want the map to be active or not. Eventually it will accomplish the same thing as the hack above (I hope) but with a simpler API ...

Printer Friendly

 
 

Contact Information

Chameleon Users List