CSS Beispiele für Flächenfüllungen (Polygone)

Beispiel 0

Das folgende Beispiel zeigt ein einfaches Polygon ohne Füllung.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: none;
	border-line:
	{
		render-quality: antialiased;
		line-width: 5px;
		line-min-width: 5;
		line-max-width: 5;
		line-color: red;
		line-color-opacity: 1.0;
		line-join: miter;
		line-miter-limit: 10px;
		line-min-miter-limit: 10;
		line-max-miter-limit: 10;
	};
}

Beispiel 1

Das folgende Beispiel zeigt ein Polygon mit einfarbiger Füllung und unterschiedlichen Umrandungslinien.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: solid;
	fill-color: RGB(150, 150, 150);
	fill-color-opacity: 1.0;
	outer-border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: red;
		line-join: round;
		line-cap: flat;
		line-dash-style: dash_dot_dot;
	};
	inner-border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: blue;
		line-join: round;
		line-cap: flat;
		line-dash-style: custom;
		line-dash-pattern: 16px, 8px;
		line-min-dash-pattern: 16, 8;
		line-max-dash-pattern: 16, 8;
	};
}

Beispiel 2

Das folgende Beispiel zeigt ein Polygon mit einer Schraffur.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: hatch_style_diagonal_cross;
	distance-between-pattern-lines: 20px;
	min-distance-between-pattern-lines: 20;
	max-distance-between-pattern-lines: 20;
	pattern-lines-width: 2px;
	min-pattern-lines-width: 2;
	max-pattern-lines-width: 2;
	fill-color: RGB(255, 0, 0);
	fill-color-opacity: 1.0;
	background-color: RGB(200, 200, 200);
	background-color-opacity: 1.0;
	border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: green;
		line-join: round;
	};
}

Beispiel 3

Das folgende Beispiel zeigt ein Polygon mit Schraffurverschiebung.

Beispiel Polygon

unordered {
	polygon {
		id0 {
			render-quality: antialiased;
			fill-pattern: hatch_style_backward_diagonal;
			distance-between-pattern-lines: 40px;
			pattern-lines-width: 3px;
			fill-color: RGB(255, 0, 0);
			background-color: RGB(200, 200, 200);
		}
		id1 {
			render-quality: antialiased;
			fill-pattern: hatch_style_backward_diagonal;
			distance-between-pattern-lines: 40px;
			pattern-lines-width: 3px;
			fill-pattern-texture-displacement-x: 10px;
			min-fill-pattern-texture-displacement-x: 0;
			max-fill-pattern-texture-displacement-x: 0;
			fill-pattern-texture-displacement-y: 0px;
			min-fill-pattern-texture-displacement-y: 0;
			max-fill-pattern-texture-displacement-y: 0;
			fill-color: RGB(0, 0, 255);
			background-color: RGBA(0, 0, 0, 0.0);
			border-line:
			{
				render-quality: antialiased;
				line-width: 7px;
				line-color: green;
				line-join: round;
			};
		}
	}
}

Beispiel 4

Das folgende Beispiel zeigt ein Polygon das mit einem Bild als Muster gefüllt ist.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: pixmap;
	fill-pattern-pixmap: "D:\\Temp\\CSS\\TestPattern.bmp";
	fill-pattern-pixmap-width: 40px;
	min-fill-pattern-pixmap-width: 40;
	max-fill-pattern-pixmap-width: 40;
	fill-pattern-pixmap-height: 40px;
	min-fill-pattern-pixmap-height: 40;
	max-fill-pattern-pixmap-height: 40;
	fill-pattern-texture-opacity: 1.0;
	border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: green;
		line-join: round;
	};
}

Beispiel 5

Das folgende Beispiel zeigt ein Polygon das mit einem benutzerdefiniertem Pixelmuster gefüllt ist.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: custom;
	fill-color: RGB(255, 0, 0);
	background-color: RGB(200, 200, 200);
	custom-fill-pattern-width: 8;
	custom-fill-pattern-height: 8;
	custom-fill-pattern: 
		0, 0, 0, 0, 1, 1, 1, 1,
		0, 0, 0, 0, 1, 1, 1, 1,
		0, 0, 0, 0, 1, 1, 1, 1,
		0, 0, 0, 0, 1, 1, 1, 1,
		1, 1, 1, 1, 0, 0, 0, 0,
		1, 1, 1, 1, 0, 0, 0, 0,
		1, 1, 1, 1, 0, 0, 0, 0,
		1, 1, 1, 1, 0, 0, 0, 0;
	fill-pattern-texture-opacity: 0.5;
}

Beispiel 6

Das folgende Beispiel zeigt ein Polygon mit einem komplexen Linienmuster als Umrandung.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: solid;
	fill-color: yellow;
	border-line:
	{
		render-quality: antialiased;
		line-width: 3px;
		line-color: red;
		line-join: round;
		complex-fill-pattern-bbox-width: 1000.0;
		complex-fill-pattern-bbox-height: 1000.0;
		complex-fill-pattern-width: 40.0px;
		complex-fill-pattern-min-width: 40.0;
		complex-fill-pattern-max-width: 40.0;
		complex-fill-pattern-height: 40.0px;
		complex-fill-pattern-min-height: 40.0;
		complex-fill-pattern-max-height: 40.0;
		complex-fill-pattern-rendering-quality: high;
		complex-fill-pattern-join: round;
		complex-fill-pattern:
			line {
				line-width: 3px;
				line-color: red;
				line-cap: round;
				x1: 500m;
				y1: 0m;
				x2: 500m;
				y2: 1000m;
			},
			arc {
				line-width: 3px;
				line-color: green;
				position-x: 500.0m;
				position-y: 500.0m;
				radius: 400.0m;
				start-angle: 0;
				sweep-angle: 360;
			};
	};
}

Beispiel 7

Das folgende Beispiel zeigt ein Polygon mit einem komplexen Muster als Füllung.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: complex;
	background-color: RGB(220, 220, 220);
	border-line:
	{
		render-quality: antialiased;
		line-width: 3px;
		line-color: red;
		line-join: round;
	};
	fill-pattern-texture-opacity: 1.0;
	complex-fill-pattern-bbox-width: 1000.0;
	complex-fill-pattern-bbox-height: 1000.0;
	complex-fill-pattern-width: 100px;
	complex-fill-pattern-min-width: 0.0;
	complex-fill-pattern-max-width: 0.0;
	complex-fill-pattern-height: 100px;
	complex-fill-pattern-min-height: 0;
	complex-fill-pattern-max-height: 0;
	complex-fill-pattern:
		line::id1 {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: red;
			line-color-opacity: 1.0;
			line-cap: round;
			x1: 100.0m;
			min-x1: 0;
			max-x1: 0;
			y1: 500.0m;
			min-y1: 0;
			max-y1: 0;
			x2: 900.0m;
			min-x2: 0;
			max-x2: 0;
			y2: 500.0m;
			min-y2: 0;
			max-y2: 0;
		},
		line::id2 {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: red;
			line-cap: round;
			x1: 500.0m;
			y1: 100.0m;
			x2: 500.0m;
			y2: 900.0m;
		},
		arc::id3 {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: green;
			line-color-opacity: 1.0;
			line-cap: round;
			radius: 180.0m;
			min-radius: 3;
			max-radius: 0;
			start-angle: 0;
			sweep-angle: 270.0;
			position-x: 250.0m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 750.0m;
			min-position-y: 0;
			max-position-y: 0;
		},
		text::id4 {
			text: "A";
			text-color: blue;
			text-color-opacity: 1.0;
			text-font-name: "Times New Roman";
			text-font-type: standard;
			text-height: 200.0m;
			min-text-height: 6;
			max-text-height: 100;
			text-height-measurement: cardo;
			text-weight: 400;
			text-style: italic;
			text-quality: antialiased;
			text-horizontal-alignment: center;
			text-vertical-alignment: center;
			position-x: 250.0m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 750.0m;
			min-position-y: 0;
			max-position-y: 0;
		},
		polyline::id5  {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: RGB(255, 255, 0);
			line-color-opacity: 1.0;
			line-join: miter;
			line-miter-limit: 10px;
			line-min-miter-limit: 10;
			line-max-miter-limit: 10;
			line-cap: flat;
			line-dash-style: custom;
			line-dash-pattern: 8px, 4px;
			line-min-dash-pattern: 8, 4;
			line-max-dash-pattern: 8, 4;
			position-x: 750.0m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 750.0m;
			min-position-y: 0;
			max-position-y: 0;
			points: (-150.0m, -150.0m), (-150.0m, 150.0m), (150.0m, 150.0m), (150.0m, -150.0m), (-150.0m, -150.0m);
			min-points: (0, 0), (0, 0), (0, 0), (0, 0), (0, 0);
			max-points: (0, 0), (0, 0), (0, 0), (0, 0), (0, 0);
		},
		pixmap::id6 {
			file-name: "D:\\Temp\\CSS\\TestPixmap.bmp";
			width: 170.0m;
			min-width: 5;
			max-width: 0;
			height: 170.0m;
			min-height: 5;
			max-height: 0;
			opacity: 0.5;
			rotation: 45.0;
			vertical-alignment: center;
			horizontal-alignment: center;
			position-x: 750.0m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 750.0m;
			min-position-y: 0;
			max-position-y: 0;
		},
		polygon::id7 {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: blue;
			line-color-opacity: 1.0;
			line-join: miter;
			line-miter-limit: 10;
			line-min-miter-limit: 0;
			line-max-miter-limit: 0;
			line-cap: flat;
			line-dash-style: custom;
			line-dash-pattern: 8px, 4px;
			line-min-dash-pattern: 0, 0;
			line-max-dash-pattern: 0, 0;
			fill-color: green;
			fill-color-opacity: 1.0;
			background-color: red;
			background-color-opacity: 1.0;
			fill-pattern: hatch_style_backward_diagonal;
			distance-between-pattern-lines: 80.0m;
			min-distance-between-pattern-lines: 2;
			max-distance-between-pattern-lines: 0;
			pattern-lines-width: 20.0m;
			min-pattern-lines-width: 1;
			max-pattern-lines-width: 0;
			fill-pattern-texture-displacement-x: 0px;
			fill-pattern-texture-displacement-y: 0px;
			fill-pattern-texture-opacity: 1.0;
			position-x: 250m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 250m;
			min-position-y: 0;
			max-position-y: 0;
			points: (-150.0m, -150.0m), (-150.0m, 150.0m), (150.0m, 150.0m), (150.0m, -150.0m);
			min-points: (0, 0), (0, 0), (0, 0), (0, 0);
			max-points: (0, 0), (0, 0), (0, 0), (0, 0);
		},
		circle::id8 {
			line-width: 30.0m;
			line-min-width: 1;
			line-max-width: 10;
			line-color: RGB(255, 0, 255);
			line-color-opacity: 1.0;
			fill-pattern: custom;
			fill-color: RGB(0, 0, 0);
			fill-color-opacity: 1.0;
			background-color: RGB(255, 255, 255);
			background-color-opacity: 1.0;
			custom-fill-pattern-width: 8;
			custom-fill-pattern-height: 8;
			custom-fill-pattern: 
				0, 0, 0, 0, 1, 1, 1, 1,
				0, 0, 0, 0, 1, 1, 1, 1,
				0, 0, 0, 0, 1, 1, 1, 1,
				0, 0, 0, 0, 1, 1, 1, 1,
				1, 1, 1, 1, 0, 0, 0, 0,
				1, 1, 1, 1, 0, 0, 0, 0,
				1, 1, 1, 1, 0, 0, 0, 0,
				1, 1, 1, 1, 0, 0, 0, 0;
			fill-pattern-texture-opacity: 0.5;
			radius: 180.0m;
			min-radius: 3;
			max-radius: 0;
			position-x: 750.0m;
			min-position-x: 0;
			max-position-x: 0;
			position-y: 250.0m;
			min-position-y: 0;
			max-position-y: 0;
		};
}

Beispiel 8

Das folgende Beispiel zeigt ein Polygon mit Text.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: solid;
	fill-color: RGB(255, 0, 0);
	fill-color-opacity: 1;
	text: "Alpha@Beta";
	text-line-break-character: @;
	text-color: green;
	text-color-opacity: 1;
	text-background-color: yellow;
	text-background-color-opacity: 1;
	text-halo-color: blue;
	text-halo-color-opacity: 1;
	text-halo-width: 5px;
	min-text-halo-width: 0;
	max-text-halo-width: 0;
	draw-text-halo-first: true;
	text-font-name: "Arial";
	text-font-type: standard;
	text-height: 30px;
	min-text-height: 0;
	max-text-height: 0;
	text-height-measurement: cardo;
	text-weight: 400;
	text-style: italic, underline;
	text-quality: antialiased;
	text-horizontal-content-alignment: center;
	text-line-spacing: 5px;
	min-text-line-spacing: 0;
	max-text-line-spacing: 0;
	text-letter-spacing: 5px;
	min-text-letter-spacing: 0;
	max-text-letter-spacing: 0;
	text-horizontal-padding: 10px;
	min-text-horizontal-padding: 0;
	max-text-horizontal-padding: 0;
	text-vertical-padding: 10px;
	min-text-vertical-padding: 0;
	max-text-vertical-padding: 0;
}

Beispiel 9

Das folgende Beispiel zeigt ein Polygon mit einer Puffer-Geometrie (Polygon).

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: hatch_style_forward_diagonal;
	distance-between-pattern-lines: 20px;
	pattern-lines-width: 2px;
	fill-color: RGB(255, 0, 0);
	background-color: RGB(200, 200, 200);
	border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: green;
		line-join: round;
	};
	buffer-distance: 30px;
	min-buffer-distance: 0;
	max-buffer-distance: 0;
	buffer-arc-segments: 10;
	buffer-polygon:
	{
		render-quality: antialiased;
		fill-pattern: hatch_style_diagonal_cross;
		distance-between-pattern-lines: 10px;
		pattern-lines-width: 2px;
		fill-color: RGB(0, 255, 0);
		background-color: RGB(200, 0, 200);
		border-line:
		{
			render-quality: antialiased;
			line-width: 3px;
			line-color: blue;
			line-join: round;
		};
	};
}

Beispiel 10

Das folgende Beispiel zeigt ein Polygon nur mit einer Puffer-Geometrie (Polygon).

Beispiel Polygon

unordered::polygon::id0 {
	buffer-distance: 30px;
	min-buffer-distance: 0;
	max-buffer-distance: 0;
	buffer-arc-segments: 10;
	buffer-polygon:
	{
		render-quality: antialiased;
		fill-pattern: hatch_style_diagonal_cross;
		distance-between-pattern-lines: 10px;
		pattern-lines-width: 2px;
		fill-color: RGB(0, 255, 0);
		background-color: RGB(200, 0, 200);
		border-line:
		{
			render-quality: antialiased;
			line-width: 3px;
			line-color: blue;
			line-join: round;
		};
	};
}

Beispiel 11

Das folgende Beispiel zeigt ein Polygon mit einem Punkt als Label.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: solid;
	fill-color: RGB(150, 150, 150);
	border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: red;
		line-join: round;
	};
	point-placement: bbox_center;
	point:
	{
		render-quality: antialiased;
		complex-graphics:
			polygon {
				line-width: 2px;
				line-color: blue;
				line-join: round;
				fill-pattern: solid;
				fill-color: white;
				points: (-60px, -40px), (-60px, 40px), (60px, 40px), (60px, -40px);
			},
			text {
				text: "Text";
				text-color: green;
				text-font-name: "Arial";
				text-font-type: standard;
				text-height: 40px;
				text-height-measurement: cardo;
				text-weight: 400;
				text-quality: antialiased;
				text-horizontal-alignment: center;
				text-vertical-alignment: center;
			};
	};
}

Beispiel 12

Das folgende Beispiel zeigt ein Polygon dessen Umrandung beschriftet ist.

Beispiel Polygon

unordered::polygon::id0 {
	render-quality: antialiased;
	fill-pattern: solid;
	fill-color: RGB(255, 0, 0);
	fill-color-opacity: 1;
	border-line:
	{
		render-quality: antialiased;
		line-width: 7px;
		line-color: green;
		line-join: round;
		text: "Label";
		text-line-break-character: @;
		text-color: green;
		text-color-opacity: 1;
		text-halo-color: blue;
		text-halo-color-opacity: 1;
		text-halo-width: 5px;
		min-text-halo-width: 0;
		max-text-halo-width: 0;
		draw-text-halo-first: true;
		text-font-name: "Arial";
		text-font-type: standard;
		text-height: 20px;
		min-text-height: 0;
		max-text-height: 0;
		text-height-measurement: cardo;
		text-weight: 400;
		text-style: italic;
		text-quality: antialiased;
		text-horizontal-content-alignment: center;
		text-line-spacing: 5px;
		min-text-line-spacing: 0;
		max-text-line-spacing: 0;
		text-letter-spacing: 5px;
		min-text-letter-spacing: 0;
		max-text-letter-spacing: 0;
		text-horizontal-padding: 10px;
		min-text-horizontal-padding: 0;
		max-text-horizontal-padding: 0;
		text-vertical-padding: 10px;
		min-text-vertical-padding: 0;
		max-text-vertical-padding: 0;
		text-start-location: start;
		text-orientation: parallel;
		text-horizontal-alignment: center;
		text-vertical-alignment: bottom;
		text-horizontal-offset: 50px;
		text-min-horizontal-offset: 0;
		text-max-horizontal-offset: 0;
		text-vertical-offset: 5px;
		text-min-vertical-offset: 0;
		text-max-vertical-offset: 0;
		text-repeat-distance: 200px;
		text-min-repeat-distance: 0;
		text-max-repeat-distance: 0;
	};
}

Beispiel 13

Das folgende Beispiel zeichnet Polygone abhängig von der Kartenskalierung und einer Signatur.

Beispiel Polygon

unordered {

 polygon [mapscale<20000] {
	Gebäude_privat [signatur=="23110"] {
		fill-color: RGB(140, 139, 139);
		fill-pattern: solid;
	}
	
	Gebäude_öffentlich [signatur=="23310"] {
		fill-color: RGB(218, 37, 29);
		fill-pattern: solid;
	}
	
	Gebäude_Kirche [signatur=="24100"] {
		fill-color: white;
		fill-pattern: solid;
		outer-border-line:
		{
		    line-width: 1.5m;
			line-min-width: 1;
			line-color: black;
			line-join: round;
			line-start-cap: round;
			line-end-cap: round;
		};
		inner-border-line:
		{
			line-width: 1.5m;
			line-min-width: 1;
			line-color: black;
			line-join: round;
			line-start-cap: round;
			line-end-cap: round;
		};
	}
	
	Gebäude_Gewächshaus [signatur=="24700_24701"] {
		fill-color: white;
		fill-pattern: solid;
		outer-border-line:
		{
			line-width: 1.5m;
			line-min-width: 1;
			line-color: RGB(0, 146, 64);
			line-join: miter;
			line-start-cap: square;
			line-end-cap: square;
		};
		inner-border-line:
		{
			line-width: 1.5m;
			line-min-width: 1;
			line-color: RGB(0, 146, 64);
			line-join: miter;
			line-start-cap: square;
			line-end-cap: square;
		};
	}
}
}


Zuletzt geändert: 07.09.2018 07:33:44 (erstmals erstellt 02.06.2017)