CartoWeb 3.5.0
Download Now!

Advanced Geographical Information System for the Web

The javascript code for map navigation was redesigned between CartoWeb version 3.0 and 3.1. It has been rewritten as a real API and allows complex features draw and management. Following you will find the main changes that occured and should be considered to avoid incompatibilities.


This section describes which changes may affect customized projects and what to do to migrate from a "PRE_DHTML" project to a new one. First, what could be our best advice is to compare your customized templates and CSS or JS files with the standard CartoWeb3 repository.

CSS Files

dhtml_tools.css is now deprecated. It has been partially replaced by dhtml.css.

The keymap.css file has been modified to suit the new positions parameters.

In cartoweb.css, mainmapcell is now deprecated. You will also find new entries for floatScale, floatGeo, floatDistance and floatSurface.

JS Files

All the *.js files except carto.js, folder.js, keymap.js are deleted or replaced. You must notice that "onLoadString" is now deprecated. Use the following sentence instead in you javascript codes:

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



A new javascript file link is used: EventManager.js.

<script type="text/javascript" src="{r type=js}EventManager.js{/r}"</script>

The "window.onload / onLoadString" section is no more used:

   {if $views|default:'' || $viewsList|default:''}<script type="text/javascript" 
   src="{r type=js plugin=views}views.js{/r}"</script>{/if}
   {include file="dhtmlcode.tpl"}
-   <script language="JavaScript" type="text/javascript">     
-     <!--    
-     {literal}   
-     window.onload = function() {    
-       if (typeof onLoadString == "string") {    
-         eval(onLoadString);     
-       }     
-     }   
-     {/literal}      
-     //-->   
-   </script>

Add following attribute to the form tag: onsubmit="doSubmit();"

   <div id="banner"><h1>{t}Cartoclient Title{/t}</h1></div>
+  <form method="post" action="{$selfUrl}" name="carto_form" onsubmit="doSubmit();">
   <input type="image" name="dummy" alt="" id="dummy" />

Add floatScale, floatDistance and floatSurface divs to your document anywhere you want.

     <td colspan="3">
       <table width="100%"><tr>
         <td width="50%"><div id="floatGeo" 
           class="locationInfo">{t}Coords (m):{/t} %s / %s</div></td>
         <td width="50%"><div id="floatDistance" class="locationInfo">{t}Dist approx.:{/t}
           %s{if $factor == 1000} km{else} m{/if}</div>
           <div id="floatSurface" class="locationInfo">{t}Approx. surface :{/t}
             %s{if $factor == 1000} km²{else} m²{/if}</div></td>


This template is almost completely modified. It shouldn't have been customized.


Make sure that you have a map div included in a mapBorder div in your template. The loadBarDiv should also be included in mapBorder.


In the case you customized the toolbar template, you'll need to modified it to integrate the new tool calling structure.

Check the radios value attribute:


Check the onclick attributes:


Exhaustive Files Modifications List


  • ClientPlugin.php modified (jsToolAttr deprecated)

  • FormRenderer.php (jsToolAttr deprecated for ToolDescription)

  • HttpRequestHandler.php modified


  • BasicTypes.php: Feature class added


  • client.ini

    • takes care of name of the default selected tool
    • zoom_in -> zoomin


  • location

    • client/ClientLocation.php modified (jsToolAttr deprecated)

    • htdocs/gfx

      • zoom_in.gif removed

      • zoom_out.gif removed

      • zoomin.gif added

      • zoomout.gif added

    • query/client/ClientQuery.php modified (jsToolAttr deprecated)

    • statictools/client/ClientStatictools.php modified (jsToolAttr deprecated)


  • dhtml_tools.css deprecated

  • cartoweb.css modified

  • dhtml.css added

  • transparent_orange.png added

  • transparent_yellow.png added

  • keymap.css modified to suit the new dhtml positions


  • dhtmlAPI.js added

  • dhtmlInit.js added

  • EventManager.js added

  • graphTools.js removed

  • navTools.js removed

  • x_core_n4.js removed

  • x_core.js removed

  • x_dom_n4.js removed

  • x_dom.js removed

  • x_event_n4.js removed

  • x_cartoweb.js added

  • wz_jsgraphics.js added


  • outline

    • client/ClientOutline.php modified (jsToolAttr deprecated)

    • templates/outlineLabel.tpl modified

    • htdocs/js/outline.js modified


  • demo: some templates and css files changed


  • cartoclient.tpl modified

  • toolbar.tpl modified

  • mainmap.tpl modified

CartoWeb Wiki: DhtmlUpdate (last edited 2020-11-22 09:35:16 by AlexSaunier)

© 2002-2007 CartoWeb by Camptocamp SA - Wiki powered by MoinMoin