[Mapserver-users] Fwd: Adding a legend to a map, can you help me please?

Steve Lime steve.lime at dnr.state.mn.us
Thu Apr 29 11:55:36 PDT 2004


Anyone fluent in WMS legends?

>>> <salemi1 at supereva.it> 4/29/2004 3:03:01 AM >>>

I've a .map as this:


LAYER
	NAME "countries"
	TYPE POLYGON
	CONNECTION "kkk"
	CONNECTIONTYPE ORACLESPATIAL
	DATA "polygons FROM firprd.nuts_gg"
	FILTER "updated_by = 'l0'"
	
	TEMPLATE "countries.html"
	DUMP TRUE
	TOLERANCE 0

	TRANSPARENCY 100
	CLASS
		NAME "Country Boundaries"
#		SYMBOL 'test1'
		OUTLINECOLOR 0 0 0
#		COLOR 225 225 185
	END

	METADATA
		WMS_TITLE "Country Boundaries"
		WMS_ABSTRACT "Europe regions boundary layer."
		WMS_SRS "EPSG:26915"
	END
END

LAYER
	NAME "regions"
	TYPE POLYGON
	CONNECTION "kkkk"
	CONNECTIONTYPE ORACLESPATIAL
	DATA "polygons FROM firprd.nuts_gg"
	FILTER "updated_by = 'l2'"
	TRANSPARENCY 100
	CLASS
#		SYMBOL "downwarddiagonalfill"
#		SYMBOL 'symbols/regions.png'
		SYMBOL 1
		SIZE 2
		OUTLINECOLOR 0 0 255
#		COLOR 225 225 185
	END

	METADATA
		WMS_TITLE "Regions Boundary"
		WMS_ABSTRACT "Europe regions boundary layer."
		WMS_SRS "EPSG:26915"
	END
END

LAYER
	NAME "provices"
	TYPE POLYGON
	CONNECTION "kkkk"
	CONNECTIONTYPE ORACLESPATIAL
	DATA "polygons FROM firprd.nuts_gg"
	FILTER "updated_by = 'l3'"
	TRANSPARENCY 90
	CLASS
#		SYMBOL "downwarddiagonalfill"
		OUTLINECOLOR 0 0 255
#		COLOR 225 225 185
	END
END

LAYER
	NAME "clc-level1"
	TYPE POLYGON
	CONNECTION "kkkkk"
	CONNECTIONTYPE ORACLESPATIAL
	DATA "polygons FROM landcover"
	MAXSCALE 750000
	MINSCALE 5000

	TRANSPARENCY 100

	CLASSITEM lce_id
	CLASS
		NAME 'Artificial Surface'
		EXPRESSION /^1[0-9][0-9]/
		COLOR	255        25       150
	END
	CLASS
		NAME 'Agricultural Areas'
		EXPRESSION /^2[0-9][0-9]/
		COLOR	255       255       200
	END
	CLASS
		NAME 'Forest and semi-natural areas'
		EXPRESSION /^3[0-9][0-9]/
		COLOR	110       240       110
	END
	CLASS
		NAME 'Wetlands'
		EXPRESSION /^4[0-9][0-9]/
		COLOR	100        60       240
	END
	CLASS
		NAME 'Water bodies'
		EXPRESSION /^5[0-9][0-9]/
		COLOR	100       240       245
	END
	# end class

END

srce=document.map.url.value+'?map='+document.map.urlFileMap.value+'&VERSION='+document.map.version.value+'&REQUEST='+document.map.request.value+'&LAYERS='+layerString+searchIF+'&BBOX='+cordMapMinX+','+cordMapMinY+','+cordMapMaxX+','+cordMapMaxY+'&WIDTH='+document.map.width.value+'&HEIGHT='+document.map.height.value+'&FORMAT='+document.map.format.value;

window.document.images['mappa'].src=srce;
		
---->>>>AND FOR THE LEGEND??
window.document.images['legendImg'].src=document.map.url.value+'?map='+document.map.urlFileMap.value+'&VERSION='+document.map.version.value+'&REQUEST=getLegend&LAYERS='+layerString+searchIF+'&BBOX='+cordMapMinX+','+cordMapMinY+','+cordMapMaxX+','+cordMapMaxY+'&WIDTH='+document.map.width.value+'&HEIGHT='+document.map.height.value+'&FORMAT='+document.map.format.value;



I want to add a legend in a new image.
What do i write in the map file? And in image.src?
Thank you
Daniele




-----------------------------------------------------------
Spazio ILLIMITATO per la tua Email, Scanner Antivirus,
Antispam, Backup e POP3. Prova la nuova Email di superEva:
http://webmail.supereva.it/ 
-----------------------------------------------------------




More information about the MapServer-users mailing list