[Chameleon] KeyMap question

Sears, Jeremy Jeremy.Sears at CCRS.NRCan.gc.ca
Mon Jan 30 13:22:17 EST 2006


Thanks Paul,
I'll try that.


-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
Sent: January 30, 2006 1:19 PM
To: Sears, Jeremy
Cc: 'chameleon at lists.maptools.org'
Subject: Re: [Chameleon] KeyMap question


Jeremy,

I would write a small server-side script to do this if I were you.   
It should be pretty easy to restore the session (include 
('session.inc.php');) and then draw the keymap using the traditional  
method.

Cheers

Paul

On 30-Jan-06, at 9:22 AM, Sears, Jeremy wrote:

> Hi Paul,
> What Im trying to do is gather essential cartographic elements from  
> the
> mapserver/chameleon application as individual images. I am puting  
> together a
> script that takes these elements and produces a custom .pdf map,  
> not overly
> dissimmilar to the print production widget. However this script  
> doesnt give
> the user any control over the creation of the map like  
> printproduction does.
>
>
> I'll look into using the regular keymap widget, however Id like to  
> retain
> the added functionality that the keymapDHTML widget provides.
>
> Thanks
> Jeremy
>
>
>
> -----Original Message-----
> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
> Sent: January 27, 2006 6:07 PM
> To: Sears, Jeremy
> Cc: 'chameleon at lists.maptools.org'
> Subject: Re: [Chameleon] KeyMap question
>
>
> sorry, javascript Document Object Model.  If you switched to using
> the regular KeyMap widget, you could get it to work with the drawmap
> hack.  Perhaps if I understood what you are trying to achieve I could
> help more?
>
> Cheers
>
> Paul
>
> On 27-Jan-06, at 4:55 PM, Sears, Jeremy wrote:
>
>> hmmm,
>> So am I correct to assume then that coaxing chameleon to produce an
>> image on
>> disk that contains my keymap + extent rectangle would involve more
>> than
>> simply modifying a line or two of code?
>>
>> What's the DOM?
>>
>> Thanks
>> Jeremy
>>
>>
>> -----Original Message-----
>> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
>> Sent: January 27, 2006 4:49 PM
>> To: Sears, Jeremy
>> Cc: 'chameleon at lists.maptools.org'
>> Subject: Re: [Chameleon] KeyMap question
>>
>>
>> OOOHHHHHH ... you are using KeyMapDHTML!!!  It just takes a copy of
>> the reference map and uses the DOM to create the red extents, so the
>> traditional reference map stuff is never used.  The image is never
>> changed.
>>
>> Cheers
>>
>> Paul
>>
>>
>> On 27-Jan-06, at 3:58 PM, Sears, Jeremy wrote:
>>
>>> Hi Paul,
>>> Thanks for you continued attention.
>>>
>>>>> Is it possible that this never gets executed and the thread of
>>>>> execution goes elsewhere?
>>>
>>> As far as I can tell, This may be the case. When I remove
>>> 'drawmap.php'
>>> entirely and fire up my app, the keymap still draws, however my
>>> main map
>>> does not. Furthermore, the keymap is still 'functional' in this
>>> situation,
>>> in that I can define a extent box to which the main map would
>>> zoom, if
>>> 'drawmap.php' were present.
>>>
>>> Also, I have tinkered with the following widgets by inserting a line
>>> simmilar to:
>>> $_SESSION['testvar']= "setfromkeymapDHTML";
>>> those widgets are : Keymap, KeymapDHTML, and KeyMapDHTMLmode
>>> $_SESSION['testvar'] only get assigned a value from 'keymapDHTML'  
>>> and
>>> 'KeymapDHTMLmode', not from 'keymap', nor does $_SESSION['testvar']
>>> get
>>> assigned when inserted in various places in 'drawmap.php'.
>>>
>>>
>>>>>  Also, is the image being saved in some
>>>>>  other location entirely?
>>>
>>> As far as I can tell, no. However Its possible I just cant find it.
>>> The
>>> source of my keymap image is a small gif of the entire extent of my
>>> geographic area of interest. It is defined in the map file as
>>> follows:
>>>
>>> #################################################################### 
>>> #
>>> #
>>> ###
>>> # Reference map
>>> #
>>> REFERENCE
>>>    IMAGE images/keymap.gif
>>>    EXTENT -2594561 -712631 3467361 3840000
>>>    STATUS ON
>>>   COLOR -1 -1 -1
>>>   OUTLINECOLOR 255 0 0
>>>   SIZE 120 90
>>> END
>>>
>>> Does Chameleon happen to save temp images somewhere in its own
>>> folders? Ive
>>> looked around but cannot find an image resembling the keymap?
>>>
>>> Can you recommend any further 'tests' or changes to the code I
>>> could make
>>> that would shed more light on what's going on with my keymap? I'm
>>> beggining
>>> to think that Chameleon is only drawing an extent rectangle over-
>>> top of my
>>> keymap rather that generating the keymap and extent rectangle as
>>> one image.
>>> Is this a possibility?
>>>
>>> Thanks
>>> Jeremy
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
>>> Sent: January 27, 2006 3:24 PM
>>> To: Sears, Jeremy
>>> Cc: 'chameleon at lists.maptools.org'
>>> Subject: Re: [Chameleon] KeyMap question
>>>
>>>
>>> Is it possible that this never gets executed and the thread of
>>> execution goes elsewhere?  Also, is the image being saved in some
>>> other location entirely?  Chameleon may be changing the imagepath
>>> from the mapfile setting and you wouldn't know it.
>>>
>>> Cheers
>>>
>>> Paul
>>>
>>> On 27-Jan-06, at 1:45 PM, Sears, Jeremy wrote:
>>>
>>>> Hi Paul,
>>>> I am picking over 'drawmap.php'. There is a function defined in
>>>> drawmap.php
>>>> that is also called in drawmap.php named 'DrawKeyMap()'. Near the
>>>> end of the
>>>> function are the following lines:
>>>>
>>>> /*
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> *
>>>> /
>>>> /*      draw the image and output
>>>> it.                                   */
>>>> /*
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> *
>>>> /
>>>>       //  $imgObj = $oMapSession->oMap->drawReferenceMap();
>>>>
>>>>       //  $szWebImage = $imgObj->saveWebImage();
>>>>
>>>> ...(lines 1408 thru 1413)...
>>>>
>>>> You have to excuse me but Im in the process of learning php. It
>>>> appears to
>>>> me that by uncommenting the two lines there, the keymap should be
>>>> created
>>>> ($imgObj) and the location of the keymap should be then stored in
>>>> ($szWebImage).
>>>>
>>>> I have uncommented the two lines however I dont see the keymap
>>>> image in my
>>>> tmp folder. Also, it would seem that nothing gets written to the
>>>> $szwebImage
>>>> variable.
>>>>
>>>> Have I overlooked other parts of drawmap.php that are relavent to
>>>> my task?
>>>> Why does uncommenting the two above mentioned lines of code
>>>> seemingly have
>>>> no effect?
>>>>
>>>> Thanks
>>>> Jeremy
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
>>>> Sent: January 27, 2006 12:16 PM
>>>> To: Sears, Jeremy
>>>> Cc: 'chameleon at lists.maptools.org'
>>>> Subject: Re: [Chameleon] KeyMap question
>>>>
>>>>
>>>> Jeremy, the image is returned from drawmap.php.  You can modify
>>>> drawmap.php to save the image as well as/instead of just returning
>>>> it.
>>>>
>>>> Cheers
>>>>
>>>> Paul
>>>>
>>>> On 27-Jan-06, at 12:03 PM, Sears, Jeremy wrote:
>>>>
>>>>> Good Day All,
>>>>> Im wondering how one would go about coaxing chameleon to produce a
>>>>> keymap
>>>>> image on disk. I've been looking around in the KeyMap, KeymapDHTML
>>>>> and
>>>>> KeymapDHTMLmode widgets for a means to do this but nothing is
>>>>> jumping out at
>>>>> me.
>>>>>
>>>>> Ideally, an image of my keymap would be produced the same manner
>>>>> that the
>>>>> image of my scalebar is produced.
>>>>>
>>>>> It looks to me that the keymap widgets create the image on the fly
>>>>> via calls
>>>>> to mapserver, and don't actually store the image.
>>>>>
>>>>> Can anyone offer general or specific steps I should consider to
>>>>> accomplish
>>>>> this?
>>>>>
>>>>> Thanks
>>>>> Jeremy
>>>>>
>>>>> _______________________________________________
>>>>> 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/|
>>>> +-----------------------------------------------------------------+
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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/|
>>> +-----------------------------------------------------------------+
>>>
>>>
>>>
>>> _______________________________________________
>>> 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/|
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Applications & Software Development                              |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
>
>
>
> _______________________________________________
> 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