[Chameleon] How do you set/get what tool is active with JSAPI?

Paul Spencer pagameba at magma.ca
Thu Jul 29 15:05:50 EDT 2004


There isn't really a mechanism in the CWC JSAPI for determining which 
tool is active, but you can check:

if (document.forms[0].NAV_CMD.value == "ZOOM_IN")
{
}

Cheers,

Paul

Ken Sanderson wrote:

> Hello. I have been getting a bit of a JSAPI script to work, pretty basic
> at this point, but if I can get the basic to work then after that its
> all javascript and php unrelated to Chameleon, so simple is good.
> 
> One thing I noticed in the JSAPI docs is that at the end it still
> references goCWCApp as the application object, but it should be
> goCWCJSAPI. Also mouseclick[#] as mentioned under the MOUSE_CLICKED
> example is not a property of oMap, it's a property of the application,
> which is goCWCJSAPI. So it should be goCWCJSAPI.mouseclick[0].
> 
> On to my question. I have my little script working for mouse click on
> the map. It pops up an alert box that gives me the geographic coords of
> the place clicked. The problem I have is that I cant find a way to set
> or retrieve what tool is currently active. I only want my script to
> function if my tool is the one that's currently active, if zoomin is
> selected then the map should zoomin as per normal.
> 
> How can I interface with the tools in this manner?
> 
> Thanks,
> 
> Ken
> Miistakis
> 
> 
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

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



More information about the Chameleon mailing list