[Chameleon] Adding Points

William A. Bronsema wbronsema at dmsolutions.ca
Mon Aug 9 07:00:14 EDT 2004


Hi Ken,

Ken Sanderson wrote:
> A few more questions in regards to adding a point, or points, to the map
> within Chameleon. Been tossing around various ideas so my questions are
> a bit mixed:
> 
> 1) I have been looking over the mapscript examples, which are fairly
> clear, what I don't understand is how I hook into the map/image that
> chameleon is going to return vs returning another image with my points
> on it. Is there a way to reference the map object that chameleon is
> using from another widget and add points to it?
Widgets have access to the map object by using: $this->moMapObject->oMap.

There are a number of widgets to look at that reference the map object. 
  Take a look at the expressionbuilder.widget.php file for example 
(specifically the parseURL function).

> 
> 2) Another method I found an exmaple on was the MapImageSharedResource
> in conjunction with SQLQuery Widget, only in my case I would likely
> create a widget to build the array of points in another method. It says
> in the example: "where you want your map, you should include the
> MapImageSharedResource". Where is that supposed to be? In the
> MAPDHTMLWIDGET table?
Sorry, I'm not too familiar with using the SQLQuery widget.  I'll leave 
that to someone else to answer.

> 
> 3) Lastly while poking around in the drawmap.php file I found some
> references to pulling points from the URL, specifically: "Draw points
> from URL if necessary" section. Has anyone used this or knows if there
> is any functions/widgets/documentation on how this might be used?
To the best of my knowledge there is nothing in Chameleon that is making 
use of that point drawing functionality.  The drawmap.php file has a 
fairly long history and this code, I believe, was added pre-Chameleon.

Although I don't think there is a way in Chameleon to access this 
functionality, it appears that the code is a complete example of how to 
add points to a new layer in your mapfile (although I haven't tried it - 
it looks like it should).

In a nutshell, what you'll need to do is create a new widget and copy 
the point creation code to it.  This will involve referencing the map 
object as indicated in question 1 ($this->moMapObject->oMap) as well as 
collecting point information (possibly as indicated in question 2 - or 
some other way).

Hope that helps.

Regards,
Bill

-- 
________________________________________________

  William A. Bronsema, C.E.T.
  Applications Developer,
  DM Solutions Group Inc.

  e-mail: wbronsema at dmsolutions.ca
  Web   : http://www.dmsolutions.ca
  Phone : (613) 565-5056 ext.25
  Fax   : (613) 565-0925
________________________________________________



More information about the Chameleon mailing list