[ka-Map-users] myKaMap.addObjectGeo strange behavior

Base Bloc chris at basebloc.com
Thu Mar 2 08:36:46 EST 2006

Hi guys,


I have been using myKaMap.addObjectGeo to lay down markers on my map with
mouseover tool tips, I have had the working and have tested it on all
browsers and was working perfectly until today.


Now myKaMap.addObjectGeo works in Firefox but produces an invalid JavaScript
argument in IE6, I thought maybe I had made a syntax error in the new code I
had added relating to tool-tips and browser specific DOM events, so I went
about debugging without success but tracking the error down to the
addObjectGeo function. So I then set up a new totally unmodified Ka-map
using the gmap data and added the following simple code at the end of the
myOnLoad function in startUp.js as followed, and to my surprise the error


function myOnLoad() {





            myKaMap = new kaMap( 'viewport' );


    var map = getQueryParam('map');

    var extents = getQueryParam('extents');

    var cps = getQueryParam('cps');


    //var myKaScalebar = new kaScalebar( myKaMap, 'scalebar' );

    var myKaLegend = new kaLegend( myKaMap, 'legend', false );

    var myKaKeymap = new kaKeymap( myKaMap, 'keymap' );


    myKaMap.registerForEvent( KAMAP_INITIALIZED, null, myInitialized );

    myKaMap.registerForEvent( KAMAP_MAP_INITIALIZED, null, myMapInitialized

    myKaMap.registerForEvent( KAMAP_SCALE_CHANGED, null, myScaleChanged );

    myKaMap.registerForEvent( KAMAP_QUERY, null, myQuery );


    myKaNavigator = new kaNavigator( myKaMap );



    myKaQuery = new kaQuery( myKaMap, KAMAP_RECT_QUERY );


    myScalebar = new ScaleBar(1);

    myScalebar.divisions = 3;

    myScalebar.subdivisions = 2;

    myScalebar.minLength = 150;

    myScalebar.maxLength = 250;




    myKaMap.initialize( map, extents, cps );


            myCanvas = myKaMap.createDrawingCanvas( 5000 );


     var marker = document.createElement( 'img' );

     marker.src = 'images/kamap.gif';


     myKaMap.addObjectGeo( myCanvas, -710141, 1303865, marker );



Now I'm sure this is the same code I was using before, so is there a problem
here or because I have been in front of the computer for eight straight
hours am I missing something very obvious right in front of my face (more
likely scenario)? 


Thanks for your input.







Christopher Brown

Head of Internet Development

Base Bloc Cambodia

#33, 123, Phnom Penh, Cambodia. 

P.O. Box 2086


Tel (+885) 12 315 302


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060302/9248d918/attachment-0001.html

More information about the ka-Map-users mailing list