[Mapserver-users] Query template - Extract: Layer Class Name
Martin, Daniel A
Daniel.A.Martin at erac.com
Wed Jan 7 11:35:00 EST 2004
The only way you can use the legend tags is within a legend template. While you could do this in a query page, I think that's going to be quite difficult to achieve what you want.
The way I do it is that I have a separate query template for each layer, and the name is hard coded. But I know this isn't going to work in many situations.
I'm sorry to say, I've thought about it, but I'm not coming up with any good answers.
> -----Original Message-----
> From: Julien, Heryk [mailto:hjulien at nrcan.gc.ca]
> Sent: Wednesday, January 07, 2004 8:56 AM
> To: Martin, Daniel A
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: [Mapserver-users] Query template - Extract: Layer Class Name
> Here is the context. I've integrated Mapserver in Coldfusion
> (Macromedia web
> server) and I'm using session variables to manage Mapserver requests.
> For example when I query a feature on a map, a Mapserver
> query or WMS query string is dynamically generated by
> coldfusion (depending on source of the
> layer) and sent directly to the server giving the MapService.
> In the present case a query is sent to Mapserver. Mapserver
> receives the request and sends a query response in html using
> the query template specified in the mapfile.
> What i would like to do is include the features legend symbol
> and description in the query response. This will permit me to
> have a query response which will include the queried feature
> shapefile dbf info and corresponding legend description
> (legende image, layer name, class name...).
> Users will be able to relate legend elements and query
> features and make sure they have selected the desired featured.
> I've tried integrating the following tags in the query
> template without success.
> They are not interpreted. The only tags interpreted are the
> ones fetching information in my dbf.
> Do you have other suggestions.
> Thanks for the help.
> -----Message d'origine-----
> De : Martin, Daniel A [mailto:Daniel.A.Martin at erac.com]
> Envoyé : Tuesday, January 06, 2004 5:17 PM
> À : Julien, Heryk
> Cc : mapserver-users at lists.gis.umn.edu
> Objet : RE: [Mapserver-users] Query template - Extract: Layer
> Class Name
> Well, I'm not quite sure. I don't know of a built-in
> variable. I guess I would want to know how your user reaches
> this query page. If it is from a link/submit from a prior
> page that DOES have a legend, I would pass the item name as a
> custom variable.
> For instance, I use a custom variable called "title" that I
> pass between every map as a hidden element of the map form.
> I can reference this variable in my template simply as
> [title] because MapServer is smart enough to pull it from the
> querystring. I place it in my <title> tag in the header, and
> output it on the template.
> > -----Original Message-----
> > From: Julien, Heryk [mailto:hjulien at nrcan.gc.ca]
> > Sent: Tuesday, January 06, 2004 3:27 PM
> > To: Martin, Daniel A
> > Cc: mapserver-users at lists.gis.umn.edu
> > Subject: RE: [Mapserver-users] Query template - Extract:
> > Layer Class Name
> > Daniel,
> > Lets say I send this kind of query:
> > http://www.cgcq.rncan.gc.ca/cgi-bin/mapserver/mapserv.exe?
> > map=d:\webcgcq\gasl_clf\mapserver\mapfiles\transect1.map&
> > mode=query&
> > layer=Transect1poly&
> > imgext=605652.980000+4900665.392862+864417.475000+5159507.282138&
> > img.x=189&
> > img.y=199&
> > IMGSIZE=400%20400&
> > Since the mode is query, the result is the mapfile query
> > template with the feature identifications requested from the
> > shapefile dbf. However the legend tags are not interpreted!
> > Is there a way to retrieve the "layer class name" of the
> > object selected in the map so that I may insert it into the
> > query template response?
> > Query template:
> > Code: [CODE]<br>
> > Identifiant = [SP_OBJ_ID]<br>
> > Dataset_ID = [DATASET_ID]
> > [leg_layer_html]
> > [leg_layer_name]
> > [/leg_layer_html]
> > [leg_class_html]
> > [leg_class_name]
> > [/leg_class_html]
> > -----Message d'origine-----
> > De : Martin, Daniel A [mailto:Daniel.A.Martin at erac.com] Envoyé :
> > Friday, December 19, 2003 4:29 PM À : Julien, Heryk;
> > mapserver-users at lists.gis.umn.edu Objet : RE:
> [Mapserver-users] Query
> > template - Extract: Layer Class Name
> > [leg_class_name]
> > But it must be used within a [leg_class_html] block.
> > For example, my legend template is attached. I think it is a
> > good example of how to effectively use an html template. It
> > is designed to be used in your client within a td element, such as:
> > <table><TR><TD>[legend]</TD></TR></table>
> > -Dan
> > > -----Original Message-----
> > > From: mapserver-users-admin at lists.gis.umn.edu
> > > [mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of
> > > Julien, Heryk
> > > Sent: Friday, December 19, 2003 2:29 PM
> > > To: 'mapserver-users at lists.gis.umn.edu'
> > > Subject: [Mapserver-users] Query template - Extract: Layer
> > Class Name
> > >
> > >
> > > Hi to all,
> > > With the object [cl]you can retrieve the current "layer
> name" from
> > > your mapfile and output it into your query template
> > > (http://mapserver.gis.umn.edu/doc40/template-reference.html#qu
> > ery). Is there a way to retrieve the "layer class name" of
> > the object selected in the map so that I may insert it into
> > the query template response?
> > Thanks
> > ==========================================
> > Héryk
> > _______________________________________________
> > Mapserver-users mailing list Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/maps> erver-users
More information about the mapserver-users