[Cartoweb-users] Tooltips plugin

zze-SIGALE PORTANERI F ext RD-BIZZ-SOP fportaneri.ext at orange-ftgroup.com
Tue Dec 19 03:44:31 EST 2006


Hi,

On my side, I tried also the ToolTips plugin in several configurations.

I successfully setup a timeout_async conf basically by doing the same steps as Oliver described here, and the plugin works fine. Unfortunately for me, in my case the basic SQL select behind this timeout_async mode is too poor (the DATA field of my layer is embedding a complex WHERE clause) and many records may be shown in the tooltips popup window.

I tried then the area_direct mode, but I was getting JavaScript errors complaining about a undefined DOM element:

	Updating GUI for plugin ToolTips
	AjaxHandler.updateDomElement(): Updating map1 element's innerHTML's value...
	Warning: given element (map1) was not found in the DOM!

I finally fixed this by loading the tooltips JavaScript in my cartoclient.tpl : 

    {if $toolTips_active|default:''}<script type="text/javascript" src="{r type=js plugin=toolTips}overlib_mini.js{/r}"></script>
    <script type="text/javascript" src="{r type=js plugin=toolTips}ToolTips.ajax.js{/r}"></script>
    {/if}

after the line: 
  
	{include file="dhtmlcode.tpl"}

After a zoom or pan operation which triggers an Ajax call, the gui is well update for the tooltips plugin and from this point, it works fine, overlib popup appears correctly.  

However, at the initial view or if a full refresh occurs (i.e. a createMap call), the ToolTips is no more active, no popup is opened, no 'mousemove' event is raised.
When I trace, I can well see event handler definition for 'mousemove' on all map elements at the initial loading, but it is like if the event handler table is discard later... 
Any tips here? Does somebody successfully setup the Tooltips plugin in area_direct mode? 
	    
Franck 

-----Message d'origine-----
De : cartoweb-users-bounces at lists.maptools.org [mailto:cartoweb-users-bounces at lists.maptools.org] De la part de Oliver Christen
Envoyé : mardi 19 décembre 2006 08:18
À : Max Ueda; cartoweb-users at lists.maptools.org
Objet : Re: [Cartoweb-users] Tooltips plugin

Hi Max

the parameters need to be put into a toolTips.ini file, placed in the client_conf folder.

in the exemple in the documentation,
timeout_async.region.xxxxxx

"region" is the name of the layer that must be queried. This layer must exist in your layers.ini.
also , if you query by x,y, the column name must be "the_geom" in the database.

be sure to have the tooltips javascript loaded into your main template
header:

      {if $toolTips_active|default:''}<script type="text/javascript" src="{r type=js plugin=toolTips}overlib_mini.js{/r}"></script>
      <script type="text/javascript" src="{r type=js plugin=toolTips}ToolTips.ajax.js{/r}"></script>
      {/if}

set your profile to "development" if its not already the case, and look at the JSTrace Debugger windows that should appear when you load the main page. 
There you should see somthing like:
AjaxPlugins.ToolTips: sending request for coords 5378....

if not, look at the source of the page and see if something like this
appear:

  /* Assigns JS state variables:
   * layerListIds and scale for toolTipsRequests
   */

  function initToolTips() {
....
and

EventManager.Add(window, 'load', initToolTips, false);

If these lines are missing, then the tooltips plugin is not loaded/initialised.

Regards
Oliver

> Hi,
>
> I've been trying to activate this plugin for some days, and I feel 
> that there is something missing.
>
> In the documentation (
> http://cartoweb.org/doc/cw3.3/xhtml/user.tooltips.html)
> , there are some issues that I couldn't understand.
>
> Everything at the client.ini and myProject.ini is set, it appears to 
> be loading (because when I did not configure the server side ini file, 
> Cartoweb threw an error message saying that it was not loaded at 
> myProject.ini).
>
> I´ve been trying to use the "Mouse Timeout Asynchronous" approach. 
> There is some piece of code on the yellow boxes of the document, that 
> at first glance, made me think that they should be placed at a new 
> toolTips.ini file, but it looks similar to the code that has to be 
> written at layers.ini . I tried to do both approaches (writing a new 
> ini file and, to write the lines at layers.ini with the name of the 
> layer I wished the plugin to display the tooltips with the object 
> data) but none of them seemed to work.
>
> I have also set ajaxOn = true at client.ini   .
>
> What am I missing to make this plugin work?
>
> Thanks in advance,
>
> Max Ueda
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 

_______________________________________________
Cartoweb-users mailing list
Cartoweb-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/cartoweb-users



More information about the Cartoweb-users mailing list