[ka-Map-users] myKaMap.addObjectGeo strange behavior
Brent Pedersen
bpederse at gmail.com
Thu Mar 2 13:06:43 EST 2006
a wild guess... try putting it in the function that is triggered from
KAMAP_MAP_INITIALIZED, IE can trigger the onload event before it's
actually ready.
or something with scope?
On 3/2/06, Base Bloc <chris at basebloc.com> wrote:
>
> 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
> persisted.
>
>
>
> function myOnLoad() {
>
> initDHTMLAPI();
>
>
>
> window.onresize=drawPage;
>
>
>
> 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 );
>
> myKaNavigator.activate();
>
>
>
> myKaQuery = new kaQuery( myKaMap, KAMAP_RECT_QUERY );
>
>
>
> myScalebar = new ScaleBar(1);
>
> myScalebar.divisions = 3;
>
> myScalebar.subdivisions = 2;
>
> myScalebar.minLength = 150;
>
> myScalebar.maxLength = 250;
>
> myScalebar.place('scalebar');
>
>
>
> drawPage();
>
> 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.
>
>
>
> Chris
>
>
>
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Christopher Brown
>
> Head of Internet Development
>
> Base Bloc Cambodia
>
> #33, 123, Phnom Penh, Cambodia.
>
> P.O. Box 2086
>
> www.basebloc.com
>
> Tel (+885) 12 315 302
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060302/62828ebc/attachment.html
More information about the ka-Map-users
mailing list