[ka-Map-users] Initialization

jochen at IngenieurTeam2.com jochen at IngenieurTeam2.com
Tue Oct 4 11:37:01 EDT 2005


When then index.html is called the first time or refreshed, there
might be a problem with the succession (I don't know the right word, perhaps
order?)
of the events. The KAMAP_MAP_INITIALIZED comes before KAMAP_INITIALIZED

This happens in this way:

<initializeCallback>
  <eval of ajax code> 
    this.selectMap  ('mymap')
    <selectMap>
      KAMAP_MAP_INITIALIZED is fired
    </selectMap>
  </eval of ajax code>
    KAMAP_INITIALIZED is fired
</initializeCallback>

When KAMAP_MAP_INITIALIZED comes before KAMAP_INITIALIZED the combobox
isn't filled with options, so it can't be selected in myMapInitialized.
I haven't got a solution for this only a workaround for the error in 
myMapInitialized.

Index: htdocs/index.html
===================================================================
RCS file: /cvs/maptools/cvsroot/ka-map/htdocs/index.html,v
retrieving revision 1.63
diff -u -r1.63 index.html
--- htdocs/index.html	27 Sep 2005 18:26:16 -0000	1.63
+++ htdocs/index.html	4 Oct 2005 15:12:25 -0000

@@ -67,7 +72,7 @@
     //alert( 'ka-Map! initialized a new map: ' + mapName );
     //make sure the map is selected ... 
     var oSelect = document.forms[0].maps;
-    if (oSelect.options[oSelect.selectedIndex].value != mapName)
+    if (oSelect.selectedIndex >= 0 &&
oSelect.options[oSelect.selectedIndex].value != mapName)
     {
         for(var i = 0; i < oSelect.options.length; i++ )
         {


More information about the ka-Map-users mailing list