385 lines
20 KiB
XML
385 lines
20 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<xs:schema xmlns:tns="http://opensciencemap.org/rendertheme"
|
||
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||
targetNamespace="http://opensciencemap.org/rendertheme" xml:lang="en">
|
||
|
||
<!-- attribute types -->
|
||
<xs:simpleType name="cap">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="butt"/>
|
||
<xs:enumeration value="round"/>
|
||
<xs:enumeration value="square"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="closed">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="yes"/>
|
||
<xs:enumeration value="no"/>
|
||
<xs:enumeration value="any"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="color">
|
||
<xs:restriction base="xs:string">
|
||
<xs:pattern value="#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="elementList">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="node"/>
|
||
<xs:enumeration value="way"/>
|
||
<xs:enumeration value="any"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="selectorList">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="first"/>
|
||
<xs:enumeration value="any"/>
|
||
<xs:enumeration value="when-matched"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="fontFamily">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="default"/>
|
||
<xs:enumeration value="default_bold"/>
|
||
<xs:enumeration value="monospace"/>
|
||
<xs:enumeration value="sans_serif"/>
|
||
<xs:enumeration value="serif"/>
|
||
<xs:enumeration value="thin"/>
|
||
<xs:enumeration value="light"/>
|
||
<xs:enumeration value="medium"/>
|
||
<xs:enumeration value="black"/>
|
||
<xs:enumeration value="condensed"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="fontStyle">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="bold"/>
|
||
<xs:enumeration value="bold_italic"/>
|
||
<xs:enumeration value="italic"/>
|
||
<xs:enumeration value="normal"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="nonNegativeFloat">
|
||
<xs:restriction base="xs:float">
|
||
<xs:minInclusive value="0"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="src">
|
||
<xs:restriction base="xs:string">
|
||
<xs:pattern value="((file|assets):)?.+"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="strokeDasharray">
|
||
<xs:restriction base="xs:string">
|
||
<xs:pattern
|
||
value="([0-9]+(\.[0-9]+)? *, *[0-9]+(\.[0-9]+)? *, *)*[0-9]+(\.[0-9]+)? *, *[0-9]+(\.[0-9]+)?"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<xs:simpleType name="textKey">
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="ele"/>
|
||
<xs:enumeration value="addr:housenumber"/>
|
||
<xs:enumeration value="addr_housenumber"/> <!-- Mapzen -->
|
||
<xs:enumeration value="housenumber"/> <!-- OpenMapTiles -->
|
||
<xs:enumeration value="name"/>
|
||
<xs:enumeration value="maxSpeed"/><!--最高速度-->
|
||
<xs:enumeration value="minSpeed"/><!--最低速度-->
|
||
<xs:enumeration value="angle"/><!--角度-->
|
||
<xs:enumeration value="ref"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
<!-- style menu cat element -->
|
||
<xs:complexType name="cat">
|
||
<xs:attribute name="id" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<!-- style menu name element -->
|
||
<xs:complexType name="name">
|
||
<xs:attribute name="lang" type="xs:string" use="required"/>
|
||
<xs:attribute name="value" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<!-- style menu overlay element -->
|
||
<xs:complexType name="overlay">
|
||
<xs:attribute name="id" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<!-- style menu layer element -->
|
||
<xs:complexType name="layer">
|
||
<xs:sequence maxOccurs="1" minOccurs="0">
|
||
<xs:element name="name" maxOccurs="unbounded" minOccurs="0" type="tns:name"/>
|
||
<xs:element name="cat" maxOccurs="unbounded" minOccurs="0" type="tns:cat"/>
|
||
<xs:element name="overlay" maxOccurs="unbounded" minOccurs="0" type="tns:overlay"/>
|
||
</xs:sequence>
|
||
<xs:attribute name="id" type="xs:string" use="required"/>
|
||
<xs:attribute name="parent" type="xs:string" use="optional"/>
|
||
<xs:attribute name="visible" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="enabled" default="false" type="xs:boolean" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<!-- rendering instructions -->
|
||
<xs:complexType name="area">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
<xs:attribute name="id" default="0" type="xs:string" use="optional"/>
|
||
<xs:attribute name="use" default="0" type="xs:string" use="optional"/>
|
||
<xs:attribute name="src" type="tns:src" use="optional"/>
|
||
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke" default="#00000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<xs:attribute name="fade" default="-1" type="xs:integer" use="optional"/>
|
||
<xs:attribute name="blend" default="-1" type="xs:integer" use="optional"/>
|
||
<xs:attribute name="blend-fill" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="mesh" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="repeat" default="true" type="xs:boolean" use="optional"/>
|
||
<!-- 长边坐标轴,默认为s -->
|
||
<xs:attribute name="longEdge" type="tns:text" default="s"/>
|
||
<!-- 是否包含方向,默认为false -->
|
||
<xs:attribute name="hasDirect" default="false" type="xs:boolean" use="optional" />
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="caption">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
<xs:attribute name="k" type="tns:textKey" use="required"/>
|
||
<xs:attribute name="dy" default="0" type="xs:float" use="optional"/>
|
||
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional"/>
|
||
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional"/>
|
||
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<xs:attribute name="bg-fill" default="#00000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<!-- polygon area expressed as a ratio to tile area, e.g. 0.1 for 10% of tile area -->
|
||
<xs:attribute name="area-size" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<!-- priority for label placement, 0 = highest priority -->
|
||
<xs:attribute name="priority" default="0" type="xs:integer" use="optional"/>
|
||
<!-- symbol src name -->
|
||
<xs:attribute name="symbol" type="tns:src" use="optional"/>
|
||
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="circle">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
<xs:attribute name="radius" type="tns:nonNegativeFloat" use="required"/>
|
||
<xs:attribute name="scale-radius" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="fill" default="#00000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke" default="#00000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="line">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
|
||
<!-- style: TODO only in style-line-->
|
||
<xs:attribute name="id" default="0" type="xs:string" use="optional"/>
|
||
|
||
<!-- inherited style -->
|
||
<xs:attribute name="use" default="0" type="xs:string" use="optional"/>
|
||
|
||
<xs:attribute name="src" type="tns:src" use="optional"/>
|
||
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="width" default="0" type="xs:float" use="optional"/>
|
||
<!-- minimum scaled width to draw outline -->
|
||
<xs:attribute name="min" default="0" type="xs:float" use="optional"/>
|
||
<xs:attribute name="dasharray" type="tns:strokeDasharray" use="optional"/>
|
||
<xs:attribute name="cap" default="round" type="tns:cap" use="optional"/>
|
||
<xs:attribute name="outline" default="" type="xs:string" use="optional"/>
|
||
<xs:attribute name="fade" default="-1" type="xs:integer" use="optional"/>
|
||
<xs:attribute name="blur" default="-1" type="xs:float" use="optional"/>
|
||
<xs:attribute name="fix" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="repeat-gap" default="200" type="xs:float" use="optional"/>
|
||
<xs:attribute name="repeat-start" default="30" type="xs:float" use="optional"/>
|
||
|
||
<!-- stipple repeat in 'pixel' -->
|
||
<xs:attribute name="stipple" default="0" type="xs:integer" use="optional"/>
|
||
<!-- stipple color -->
|
||
<xs:attribute name="stipple-stroke" default="#000000" type="tns:color" use="optional"/>
|
||
<!-- stipple width relative to line width, i.e 0.0-1.0 -->
|
||
<xs:attribute name="stipple-width" default="0" type="xs:float" use="optional"/>
|
||
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="text">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
|
||
<xs:attribute name="id" default="0" type="xs:string" use="optional"/>
|
||
<xs:attribute name="use" default="0" type="xs:string" use="optional"/>
|
||
|
||
<xs:attribute name="k" default="name" type="tns:textKey" use="optional"/>
|
||
<xs:attribute name="dy" default="0" type="xs:float" use="optional"/>
|
||
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional"/>
|
||
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional"/>
|
||
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<xs:attribute name="bg-fill" default="#00000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional"/>
|
||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<xs:attribute name="caption" default="false" type="xs:boolean" use="optional"/>
|
||
<!-- polygon area expressed as a ratio to tile area, e.g. 0.1 for 10% of tile area -->
|
||
<xs:attribute name="area-size" default="0" type="tns:nonNegativeFloat" use="optional"/>
|
||
<!-- priority for label placement, 0 = highest priority -->
|
||
<xs:attribute name="priority" default="0" type="xs:integer" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="symbol">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
|
||
<xs:attribute name="id" default="0" type="xs:string" use="optional"/>
|
||
<xs:attribute name="use" default="0" type="xs:string" use="optional"/>
|
||
|
||
<!-- 使用动态图标时,以@符号开头,建议动态tag的key使用较长(大于4位)的字符串 -->
|
||
<xs:attribute name="src" type="tns:src" use="optional"/>
|
||
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional"/>
|
||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional"/>
|
||
|
||
<!-- symbols on lines -->
|
||
<xs:attribute name="billboard" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="repeat" default="false" type="xs:boolean" use="optional"/>
|
||
<xs:attribute name="repeat-gap" default="200" type="xs:float" use="optional"/>
|
||
<xs:attribute name="repeat-start" default="30" type="xs:float" use="optional"/>
|
||
<xs:attribute name="rotate" default="true" type="xs:boolean" use="optional"/>
|
||
<!-- 设置是否支持图标压盖,如果为true,则同点位图标不避让,允许压盖,否则支持自动避让 -->
|
||
<xs:attribute name="gland" default="false" type="xs:boolean" use="optional"/>
|
||
<!-- 原图标旋转角度,默认情况下应该使用以X轴为正方向的图标,此处可设置原图标的旋转角度,在渲染时自动对图标进行旋转,仅支持线要素 -->
|
||
<xs:attribute name="degree" default="0" type="xs:float" use="optional"/>
|
||
<!-- 图标在y轴方向上的偏移量 -->
|
||
<xs:attribute name="dy" default="0" type="xs:float" use="optional"/>
|
||
<!-- symbol的背景图片,常用来绘制立标 -->
|
||
<xs:attribute name="background" type="tns:src" use="optional"/>
|
||
<!-- symbol的内容图片的占用区域,必须为4个数字组成,英文逗号分隔的字符串,值为左,右,上,下的百分比 -->
|
||
<xs:attribute name="content-rect" type="xs:string" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="extrusion">
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
<xs:attribute name="line-color" type="tns:color" use="optional"/>
|
||
<xs:attribute name="side-color" type="tns:color" use="required"/>
|
||
<xs:attribute name="top-color" type="tns:color" use="required"/>
|
||
<xs:attribute name="hsv-h" default="0" type="xs:double" use="optional"/>
|
||
<xs:attribute name="hsv-s" default="1" type="xs:double" use="optional"/>
|
||
<xs:attribute name="hsv-v" default="1" type="xs:double" use="optional"/>
|
||
<!-- 12m default -->
|
||
<xs:attribute name="default-height" default="12" type="xs:positiveInteger" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<!-- match elements -->
|
||
<xs:complexType name="m">
|
||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||
<!-- recursion to allow for nested m -->
|
||
<xs:element name="m" type="tns:m"/>
|
||
|
||
<xs:element name="area" type="tns:area"/>
|
||
<xs:element name="caption" type="tns:caption"/>
|
||
<xs:element name="circle" type="tns:circle"/>
|
||
<xs:element name="line" type="tns:line"/>
|
||
<xs:element name="outline" type="tns:line"/>
|
||
<xs:element name="lineSymbol" type="tns:line"/>
|
||
<xs:element name="text" type="tns:text"/>
|
||
<xs:element name="extrusion" type="tns:extrusion"/>
|
||
<xs:element name="symbol" type="tns:symbol"/>
|
||
|
||
<!-- outline is defined within rules to match layering -->
|
||
<xs:element name="outline-layer" type="tns:line"/>
|
||
</xs:choice>
|
||
|
||
<xs:attribute name="select" default="any" type="tns:selectorList" use="optional"/>
|
||
<xs:attribute name="e" type="tns:elementList" use="optional"/>
|
||
<xs:attribute name="k" type="xs:string" use="optional"/>
|
||
<xs:attribute name="v" type="xs:string" use="optional"/>
|
||
<xs:attribute name="cat" type="xs:string" use="optional"/>
|
||
<xs:attribute name="closed" default="any" type="tns:closed" use="optional"/>
|
||
<xs:attribute name="zoom-min" default="0" type="xs:unsignedByte" use="optional"/>
|
||
<xs:attribute name="zoom-max" default="127" type="xs:unsignedByte" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="atlasRect">
|
||
<xs:attribute name="id" type="xs:string" use="required"/>
|
||
<xs:attribute name="pos" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<xs:complexType name="atlas">
|
||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||
<xs:element name="rect" type="tns:atlasRect"/>
|
||
</xs:choice>
|
||
<xs:attribute name="img" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<!-- stylemenu element -->
|
||
<xs:complexType name="stylemenu">
|
||
<xs:sequence maxOccurs="1" minOccurs="0">
|
||
<xs:element name="layer" maxOccurs="unbounded" minOccurs="0" type="tns:layer"/>
|
||
</xs:sequence>
|
||
<xs:attribute name="defaultvalue" type="xs:string" use="required"/>
|
||
<xs:attribute name="defaultlang" type="xs:string" use="required"/>
|
||
<xs:attribute name="id" type="xs:string" use="required"/>
|
||
</xs:complexType>
|
||
|
||
<!-- tag-transform element -->
|
||
<xs:complexType name="tag-transform">
|
||
<xs:attribute name="k" type="xs:string" use="required"/>
|
||
<xs:attribute name="v" type="xs:string" use="optional"/>
|
||
<xs:attribute name="k-lib" type="xs:string" use="required"/>
|
||
<xs:attribute name="v-lib" type="xs:string" use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<!-- rendertheme element -->
|
||
<xs:complexType name="rendertheme">
|
||
<xs:sequence maxOccurs="1" minOccurs="0">
|
||
<xs:element name="stylemenu" maxOccurs="1" minOccurs="0" type="tns:stylemenu"/>
|
||
|
||
<!-- tag definitions -->
|
||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||
<xs:element name="tag-transform" type="tns:tag-transform"/>
|
||
</xs:choice>
|
||
|
||
<!-- style definitions -->
|
||
<xs:sequence maxOccurs="256" minOccurs="0">
|
||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||
<xs:element name="style-text" type="tns:text"/>
|
||
<xs:element name="style-symbol" type="tns:symbol"/>
|
||
<xs:element name="style-area" type="tns:area"/>
|
||
<xs:element name="style-line" type="tns:line"/>
|
||
<!-- <xs:element name="style-outline" type="tns:line" /> -->
|
||
</xs:choice>
|
||
</xs:sequence>
|
||
|
||
<xs:choice maxOccurs="1" minOccurs="0">
|
||
<xs:element name="atlas" type="tns:atlas"/>
|
||
</xs:choice>
|
||
|
||
<!-- matching rules -->
|
||
<xs:sequence maxOccurs="unbounded" minOccurs="0">
|
||
<xs:element name="m" type="tns:m"/>
|
||
</xs:sequence>
|
||
</xs:sequence>
|
||
<xs:attribute name="version" type="xs:positiveInteger" use="required"/>
|
||
<xs:attribute name="map-background" default="#ffffff" type="tns:color" use="optional"/>
|
||
<xs:attribute name="base-stroke-width" default="1" type="tns:nonNegativeFloat"
|
||
use="optional"/>
|
||
<xs:attribute name="base-text-scale" default="1" type="tns:nonNegativeFloat"
|
||
use="optional"/>
|
||
</xs:complexType>
|
||
|
||
<!-- root element -->
|
||
<xs:element name="rendertheme" type="tns:rendertheme"/>
|
||
</xs:schema>
|