[Chameleon] RE: further keymap question ...

Sears, Jeremy Jeremy.Sears at CCRS.NRCan.gc.ca
Fri Feb 3 11:34:52 EST 2006


Wicked!
You're right, drawReferencemap() is doing exactly what I needed.
Thanks again for your help!
Jeremy

-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
Sent: February 2, 2006 12:04 PM
To: Sears, Jeremy
Cc: 'chameleon at lists.maptools.org'
Subject: Re: further keymap question ...


Jeremy ... drawReferenceMap should do that for you, its a mapserver  
internal thing.  The reference map object in the map file has defined  
extents that match the geographic extents of the image and when you  
set the map extents (which is done in the session handling stuff  
automagically) and call drawReferenceMap, it automatically adds the  
current extents based on your settings in the reference map object.

If it is not adding the extents, then there may be another problem :(

Cheers

Paul

On 2-Feb-06, at 10:28 AM, Sears, Jeremy wrote:

>
>> ... 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?
>
> Hi Paul,
> Following your suggestion above Ive switched to using the regular  
> keymap
> widget as I think this would be the simplest solution to generating  
> a keymap
> image on disk. As mentioned previously, Ive uncommented the  
> following lines
> of code in drawmap.php:
>
>>>  $imgObj = $oMapSession->oMap->drawReferenceMap();
>>>  $szWebImage = $imgObj->saveWebImage();
> (lines 1411-1413 Approx.)
>
> A keymap image is now generated in my tmp image folder however the  
> extent
> rectangle is not present on the image. When I query the properties  
> of the
> keymap that is displayed on my map app the address of the keymap  
> image is
> show as follows : javascript:KeyMapClicked(). Is it correct to  
> assume that
> the coordinates of the rectangle that is drawn on the keymap are  
> processed
> in 'drawmap.php' and then returned to a javascript function that  
> inturn
> dynamically draws the extent rectangle on the screen? As I attempt  
> to wade
> through and understand what's going on in drawmap.php I notice that  
> the
> extent coordinates are dealt with. Would it be possible to modify
> drawmap.php further in order to create a keymap image that includes  
> the
> extent rectangle? If so can you suggest a starting point or perhaps  
> the
> function(s) I should focus on in order to achieve this?
>
> Many Thanks
> Jeremy
>
>
>
>

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





More information about the Chameleon mailing list