Peter

there is an acceptable easy solution and a complicated one that I would 
not recommend to anybody not knowing well p.mapper.

The first one means that all available layers are already predefined in 
the map file. I don't know if this is feasible in your situation. Then 
just the 'allGroups' session variable has to be updated, and maybe some 
minor modifications. Map and TOC reload. I'm currently working on a 
plugin that lets the user choose to add complete categories and layers 
to the TOC or remove them from there. But all layers need to be 
available in the map file.

If you want to *create* layers dynamically then you have to add them to 
the map creation and query workflow and to the p.mapper groupList 
session var that contains all properties of layers and groups. This is 
not straightforward and can become tedious.

I always wanted to provide some kind of standardized method to 
accomplish this but it never was important enough to be followed 
intensively. It is on a virtual todo list, but I cannot say if it will 
be in the next 3 months or next year when I'll be working on it... You 
can have a look at some mails that I exchanged a while ago with one user 
how to try to get this working. I never got any feedback if he finally 
succeeded or not. You will be very likely at your own to get it sorted out.

Dynamic layers could become easier if either
- the map file were created for every user and stored in a temp file
- the map is saved as a full session variable (what I don't know if it 
works completely)

But both solutions would have some caveats and possible new problems , 
let alone possible bugs and strange behaviour of Mapscript that one 
might run into after a while as it happened now every now and then.

armin

Peter Wilkins wrote:
> Hi Armin,
> 
> Thanks for the quick reply!  Apologies for not being detailed enough.
> 
> What I am trying to do is the following:
> 
> User clicks on the map.  Function zoompoint is called.  I have added
> logic to this function to project the clicked point into a common
> coordinate system and then check this point against a PostGIS database
> to see which raster layers overlap the clicked point.
> 
> In the case that a single record is returned, I use Mapscript to create
> a new layerObj and display this raster (that exists out on the network
> somewhere).  This works great.
> 
> In the case of multiple records being returned, I need to devise some
> way for the user to choose amongst the raster options.  The one he
> chooses will be set as an active layer.
> 
> The two ways I have been trying to accomplish this have been 
> 
> 1) hacking the legend so that it dynamically refreshes and displays ALL
> the new layers that matched this point so the user can decide which one
> to turn on,
> 
> 2) creating a popup window with the choices.  Once the user selects a
> choice it is sent back to the application and the layer is activated.
> 
> I'd much rather do 1) but it seems to be very hard.  I'm also working on
> 2).  
> 
> My question is, are either of these approaches possible, if so how, if
> not, what would be a reasonable alternative?
> 
> Thank you!
> 
> Peter Wilkins
> Programmer / Analyst
> Advanced Technologies
> direct line: 505.798.7845
> 
> email: [EMAIL PROTECTED]
> 
> Bohannan Huston, Inc.
> Courtyard I, 7500 Jefferson St. NE
> Albuquerque, NM  87109-4335
> www.bhinc.com
> voice: 505.823.1000  facsimile: 505.823.1234  toll free: 800.877.5332
> 
>  
>  
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Armin Burger [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 22, 2007 12:03 PM
> To: Peter Wilkins
> Cc: [email protected]
> Subject: Re: [pmapper-users] Dynamic Layers from PostGIS?
> 
> Peter
> 
> I don't really have a clue what you are exactly intending to do. If you 
> could describe it a bit clearer and in more detail I might be able to 
> give you more help.
> 
> armin
> 
> Peter Wilkins wrote:
>> Hello,
>>
>>  
>>
>> I've read both relevant threads on this topic:
>>
>>  
>>
>>
> http://www.mail-archive.com/[email protected]/msg00516
>> .html
>>
>>  
>>
>> and
>>
>>  
>>
>>
> https://sourceforge.net/mailarchive/forum.php?thread_name=a228d3e0061130
> 1503w438e6118g228942b821080627%40mail.gmail.com&forum_name=pmapper-users
>>  
>>
>> I've only been using pmapper for a few days so I apologize for any
>> newbiness.  After reading the above threads I am still unable to
> figure
>> out how to get either:
>>
>>  
>>
>> A)      a dynamic legend that I can refresh whenever I pull a new
> layer
>>> >from PostGIS.
>>  
>>
>> Or
>>
>>  
>>
>> B)      a popup created with the choices from PostGIS displayed, and
>> upon selecting one the popup vanishes and the selected layer is
>> displayed.
>>
>>  
>>
>> I'm currently accessing PostGIS from within map.php.  The new layer
>> displays just fine on the map, but in my case there may be several
>> results from a single click and I need to create a way for the user to
>> choose amongst the returned layer results.
>>
>>  
>>
>> Thanks very much,
>>
>>  
>>
>> Peter Wilkins
>> Programmer / Analyst
>> Advanced Technologies
>> direct line: 505.798.7845
>>
>> email: [EMAIL PROTECTED]
>>
>> Bohannan Huston, Inc.
>> Courtyard I, 7500 Jefferson St. NE
>> Albuquerque, NM  87109-4335
>> www.bhinc.com <http://www.bhinc.com/> 
>> voice: 505.823.1000  facsimile: 505.823.1234  toll free: 800.877.5332
>>
>>  
>>
>>  
>>
>>  
>>
>>
> ------------------------------------------------------------------------
> -
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> pmapper-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to