[ka-Map-users] ka-Map map file list bug

Paul Spencer pspencer at dmsolutions.ca
Thu Jan 19 13:34:21 EST 2006


yes.  I've been playing with prototype.js and it mangles array  
iteration using the for (var i in a) syntax by including functions in  
the resulting iteration.  I'll probably change how this works at some  
point to make it more resilient.

Cheers

Paul

On 19-Jan-06, at 1:27 PM, Tim Schaub wrote:

>> this.aMaps[oMap.name] = oMap;  [line 1548]
>>
>> which creates a JavaScript associative array object element
>
> Good point.  Since JavaScript doesn't actually have "associative
> arrays", it would really make more sense to initialize this with:
>
> this.aMaps = new Object();
>
> Then, folks wouldn't be tempted to use Array properties like length.
>
>> However, since the aMaps array was loaded as an associative
>> array, aMaps.length is always zero
>
> Right, this is a typical problem when people are accessing what are
> really just properties of an Object (instead of elements in an Array).
> You'd also get unexpected results if you tried to use Array specific
> methods like join(), shift(), sort(), etc.
>
>> David
>>
>
> Tim
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+






More information about the ka-Map-users mailing list