1.9. SVG <polygon>

发布时间 : 2025-10-25 13:33:30 UTC      

Page Views: 9 views

1.9.1. SVG Polygon-

Example 1

Labels are used to create shapes with no less than three sides.

A polygon is made up of straight lines and its shape is “closed” (all the lines are connected).

Polygon is from Greece. “Poly” means “many” and “gon” means “angle”.

Here is the SVG code:

Example

<svgheight="210"width="500"><polygonpoints="200,10 250,190 160,210"style="fill:lime;stroke:purple;stroke-width:1"/> 

For Opera users: view the SVG file (right-click the SVG drawing preview source).

Code parsing:

  • points Property defines the x and y coordinates of each corner of a polygon

Example 2

The following example creates a four-sided polygon:

Here is the SVG code:

Example

<svgheight="250"width="500"><polygonpoints="220,10 300,210 170,250 123,234"style="fill:lime;stroke:purple;stroke-width:1"/> 

For Opera users: view the SVG file (right-click the SVG drawing preview source).

Example 3

Use element to create a star:

Here is the SVG code:

Example

<svgheight="210"width="500"><polygonpoints="100,10 40,198 190,78 10,78 160,198"style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;"/> 

For Opera users: view the SVG file (right-click the SVG drawing preview source).

Example 4

Change the fill-rule property to “evenodd”:

Here is the SVG code:

Example

<svgheight="210"width="500"><polygonpoints="100,10 40,198 190,78 10,78 160,198"style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"/> 

For Opera users: view the SVG file (right-click the SVG drawing preview source).

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。