[Chameleon] Widgets or JSAPI

Seiple, Timothy E timothy.seiple at pnl.gov
Tue Aug 16 19:50:14 EDT 2005

You mention "grabbing these values with [my] onclick when over the map".
How do I build this onclick event?

Let's say I have an html button in my template that calls a JavaScript
function.  This function would have to somehow focus on the mouse,
access the map object, and accept onclick event arguments - all from the
template file.

I see the JSAPI offers the mouseclick property of the CWCApplication.
Is there an equivalent widget property (e.g. <cwc2 type=MapDHTML
onclick=getxy() .../>)?

-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Jason
Sent: Tuesday, August 16, 2005 10:21 AM
To: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Widgets or JSAPI


I think the cursorpos widget populates the CursorPos_X, CursorPos_Y form
vars with the current geographic position:


(note that these are the cursospos labels)

You could grab these values with your onclick when over the map and pass
them back to your opener.

I would take a look at the MapNotes widget.  It has much of the
functionality that you going after ... it should shed some light.  This
functionality includes allowing a widget to have control over map
onclicks, etc.

You shouldn't have to use JSAPI for this functionality - it can be
achieved with Chameleon in the default mode.


Seiple, Timothy E wrote:
> I have a web application that requires the user to manually enter 
> coordinate information into a form.  I would like to provide a button,

> whose on_click event will launch an instance of chameleon with a map 
> that allows the user to click on the map to get the coordinates.  The 
> coordinates must then be passed as variables back to the calling form.
> A remote Oracle DB will provide the spatial data and store the 
> captured coordinate information.
> Can I do this with Widgets or must I use the JSAPI?  I am confused 
> about where I can place scripts.  For example, my template uses the 
> Cursorpos Widget to dynamically display {x,y} but how do I capture 
> these in variables that can be passed to other pages?  I can see the 
> Chameleon generated JavaScripts and variables in the page source but 
> don't know how to interact with them.
> I need some help understanding the big picture.
> Thanks,
> Tim
> ----------------------------------------------------------------------
> --
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

Jason Fournier

DM Solutions Group Inc.
jfournier at dmsolutions.ca
613.565.5056 x18
Chameleon mailing list
Chameleon at lists.maptools.org

More information about the Chameleon mailing list