[Chameleon] Query and LegendTemplate Questions

Jennifer Zeisloft jzeisloft at gmail.com
Fri Jan 21 01:28:12 EST 2005


Hello All,

I believe these are largely Chameleon questions, but may also have a
bit to do with MapServer mapfiles.  I've searched both documentation
and past archives of both list-servs but have been unable to figure
this one out on my own.  I really appreciate any help that is offered.
 Thank you in advance!!

Firstly, I would like to identify features in a polygon layer using
the Query widget.  I have been able to accomplish this with a query
template that accesses the .dbf file of the polygon layer, and with a
QUERY type layer in the mapfile.  However, I would like to combine the
polygon and query layers into a single layer in the chameleon legend
so that when a polygon layer is active, it is queryable.  I am sure
this is possible, but my understanding is that a QUERY layer does not
draw anything and a POLYGON layer cannot also be a QUERY layer.

Also, I am wondering how this relates to the Layer Info popup window
that appears when a layer in the legend is clicked.  A category in
this window is "queryable?" and has always shown "no".  The query
layer does not bring up a Layer Info window - I think because the
layer has no "NAME" - and giving this layer a name results in an error
message:

Warning: [MapServer Error]: getString(): Parsing error near
(query):(line 139) in
C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php on line
215

Warning: Failed to open map file
C:\ms4w\apps\chameleon\samples\htdocs/../map/circletour4.map in
C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php on line
215
ERROR: Invalid map file file
(C:\ms4w\apps\chameleon\samples\htdocs/../map/circletour4.map).
Fatal error: Call to a member function on a non-object in
C:\ms4w\apps\chameleon\htdocs\widgets\KeyMapDHTML\KeyMapDHTML.widget.php
on line 108

Is there a way to resolve this?

Secondly, it seems to me that the html for each query results popup
window is generated automatically as a temp file and that it is
generated as the result of a combination of popup.php, popup.css,
queryresults.phtml, and query.widget.php files.  I would rather not
delve into php at this point - is there a way for a non-programmer to
change the format of the query results popup window?  For example, I
would like to have a vertical rather than horizontal display of the
results, and perhaps be able to modify the title of the popup window.

Thank you again for your help!

Jennifer Zeisloft


Just in case, here is the relevant code from the mapfile:

QUERYMAP
  outlinecolor 0 0 0
  COLOR 255 255 0
  SIZE 200 200
  STATUS ON
  STYLE HILITE
END

LAYER
	NAME region
	DATA lsupregion
	TYPE POLYGON
	#TYPE QUERY
	STATUS DEFAULT
	PROJECTION
		"init=epsg:33002"
	END
	
	CLASSITEM "FeaType"
	CLASS
		NAME "Lakes"
		EXPRESSION 'Lake'
		COLOR 233 237 245
		OUTLINECOLOR 175 175 175
	END
	
	CLASS
		NAME "Wisconsin"
		EXPRESSION 'WI County'
		COLOR 254 252 245
		OUTLINECOLOR 175 175 175
	END

	CLASS
		NAME "Minnesota"
		EXPRESSION 'MN County'
		COLOR 243 239 254
		OUTLINECOLOR 175 175 175
	END
	
	CLASS
		NAME "Michigan"
		EXPRESSION 'MI County'
		COLOR 230 235 228
		OUTLINECOLOR 175 175 175
	END

	CLASS
		NAME "Ontario"
		EXPRESSION 'Province'
		COLOR 252 252 252
		OUTLINECOLOR 175 175 175
	END

	METADATA
		"WMS_TITLE" "Lake Superior Region"
		"WMS_NAME" "Lake Superior Region"
		"CLASSES" "yes"
		"ALWAYSON" "no"
	END

END

LAYER
	#NAME query
	DATA lsupregion
	TYPE QUERY
	STATUS ON
	CLASS
		TEMPLATE "lsupregion_qtemplate.html"
	END

	METADATA
		"WMS_TITLE" "query"
		"WMS_NAME" "query"
		"CLASSES" "yes"
		"ALWAYSON" "no"
	END
END


More information about the Chameleon mailing list