simplestyle-spec

A simple specification for styling GeoJSON data.

Versions

1.1.0

Adds properties to permit styling of Polygon and LineString types.

1.0.0

Initial release: this defines only three keys and an example encoding.

Implementations

Authors

  • Tom MacWright
  • Will White
  • Dave Cole
  • Young Hahn

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

simplestyle-spec

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

1. Purpose

This specification attempts to create a standard for styling geospatial data that can be shared across clients.

2. File format

simplestyle is a set of agreed-upon 'special values' in the pre-existing GeoJSON data standard that define styles. As such, files implementing simplestyle are by definition valid GeoJSON files and valid JSON files.

3. Client Behavior

The entirety of the simplestyle spec is optional, so any combination of specified properties are valid. When properties are not given, the defaults below are assumed by implementations.

Multi features are assumed to have the same styling rules as single features--- MultiPoints are styled as Points, MultiPolygons as Polygons, and MultiLineStrings as LineStrings. marker styles do not affect stroke and fill rules and vice versa. The behavior of fill rules on LineStrings is undefined, but implementations are encouraged to set fill to 0 by default in that case.

// COLOR RULES
// Colors can be in short form:
// "#ace"
// or long form
// "#aaccee"
// with or without the # prefix.
// Colors are interpreted the same as in CSS,
// in #RRGGBB and #RGB order.
// But other color formats or named colors
// are not supported
{
"type": "FeatureCollection",
"features": [{ "type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0, 0]
},
"properties": {
// OPTIONAL: default ""
// A title to show when this item is clicked or
// hovered over
"title": "A title", // OPTIONAL: default ""
// A description to show when this item is clicked or
// hovered over
"description": "A description", // OPTIONAL: default "medium"
// specify the size of the marker. sizes
// can be different pixel sizes in different
// implementations
// Value must be one of
// "small"
// "medium"
// "large"
"marker-size": "medium", // OPTIONAL: default ""
// a symbol to position in the center of this icon
// if not provided or "", no symbol is overlaid
// and only the marker is shown
// Allowed values include
// - Icon ID from the Maki project at http://mapbox.com/maki/
// - An integer 0 through 9
// - A lowercase character "a" through "z"
"marker-symbol": "bus", // OPTIONAL: default "7e7e7e"
// the marker's color
//
// value must follow COLOR RULES
"marker-color": "#fff", // OPTIONAL: default "555555"
// the color of a line as part of a polygon, polyline, or
// multigeometry
//
// value must follow COLOR RULES
"stroke": "#555555", // OPTIONAL: default 1.0
// the opacity of the line component of a polygon, polyline, or
// multigeometry
//
// value must be a floating point number greater than or equal to
// zero and less or equal to than one
"stroke-opacity": 1.0, // OPTIONAL: default 2
// the width of the line component of a polygon, polyline, or
// multigeometry
//
// value must be a floating point number greater than or equal to 0
"stroke-width": 2, // OPTIONAL: default "555555"
// the color of the interior of a polygon
//
// value must follow COLOR RULES
"fill": "#555555", // OPTIONAL: default 0.6
// the opacity of the interior of a polygon. Implementations
// may choose to set this to 0 for line features.
//
// value must be a floating point number greater than or equal to
// zero and less or equal to than one
"fill-opacity": 0.5
}
}]
}

simplestyle的更多相关文章

  1. ASP.NET在主题中添加CSS文件

    ASP.NET在主题中添加CSS文件 在ASP.NET中,可以使用CSS来控制页面上HTML元素和ASP.NET控件的皮肤.如果在主题文件夹中添加了CSS文件,则在页面应用主题时也会自动应用CSS. ...

  2. 【转】WPF的知识

    [-] 闲话WPF之二XAML概述 闲话WPF之五XAML中的类型转换 闲话WPF之十六WPF中的资源 2 闲话WPF之十九WPF中的传递事件 1 闲话WPF之二十WPF中的传递事件 2 闲话WPF之 ...

  3. 使用GeoServer+OpenLayers发布和调用WMTS、Vector Tile矢量切片服务 | Publishing and Calling WMTS, Vector Tile Service Using GeoServer + OpenLayers

    Web GIS系列: 1.搭建简易Web GIS网站:使用GeoServer+PostgreSQL+PostGIS+OpenLayers3 2.使用GeoServer+QGIS发布WMTS服务 3.使 ...

  4. 高仿Android网易云音乐OkHttp+Retrofit+RxJava+Glide+MVC+MVVM

    简介 这是一个使用Java(以后还会推出Kotlin版本)语言,从0开发一个Android平台,接近企业级的项目(我的云音乐),包含了基础内容,高级内容,项目封装,项目重构等知识:主要是使用系统功能, ...

随机推荐

  1. SQLite学习笔记(十)&&加密

    随着移动互联网的发展,手机使用越来越广泛,sqlite作为手机端存储的一种解决方案,使用也非常普遍.但是sqlite本身安全特性却比较弱,比如不支持用户权限,只要能获取到数据库文件就能进行访问:另外也 ...

  2. Linux:将rhel yum 切换到centos yum

    Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with RHN. RHN support wi ...

  3. 12个小技巧,让你高效使用Eclipse

    集成开发环境(IDE)让应用开发更加容易.它们强调语法,让你知道是否你存在编译错误,在众多的其他事情中允许你单步调试代码.像所有的IDE一 样,Eclipse也有快捷键和小工具,这些会让您感觉轻松许多 ...

  4. Struts的文件上传下载

    Struts的文件上传下载 1.文件上传 Struts2的文件上传也是使用fileUpload的组件,这个组默认是集合在框架里面的.且是使用拦截器:<interceptor name=" ...

  5. ubuntu14 安装及卸载vmware

    原帖http://blog.sina.com.cn/s/blog_73dac6b50101gp4f.html 适用于ubuntu14和vmware player 12.5

  6. subline text3 使用总结

    安装:http://www.sublimetext.com/3 插件扩展:  安装package control组件 按Ctrl+`调出console(注:安装有QQ输入法的这个快捷键会有冲突的,输入 ...

  7. Thinking in Unity3D:基于物理着色(PBS)的材质系统

    关于<Thinking in Unity3D> 笔者在研究和使用Unity3D的过程中,获得了一些Unity3D方面的信息,同时也感叹Unity3D设计之精妙.不得不说,笔者最近几年的引擎 ...

  8. Java 8函数编程轻松入门(四)方法引用

    C#中系统提供了许多IEnumerable的扩展方法.同样在Java 8中新引入了Collector类. 1.方法引用 定义: 简而言之:就是一个Lambda表达式.在Java 8中,我们我们会使用L ...

  9. angular view之间的数据传递

    之前写过一篇backbone view之间的传递,由于现在在用angular搞开发,现在也来总结一下.在angular 传递数据通俗的讲叫做 广播 ,在一些文章中,也叫做事件的发布与订阅,在angul ...

  10. 用Hibernate和Struts2+jsp实现分页查询、修改删除

    1.首先用get的方法传递一个页数过去 2.通过Struts2跳转到Action 3.通过request接受主页面index传过的页数,此时页数是1, 然后调用service层的方法获取DAO层分页查 ...