simplestyle
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的更多相关文章
- ASP.NET在主题中添加CSS文件
ASP.NET在主题中添加CSS文件 在ASP.NET中,可以使用CSS来控制页面上HTML元素和ASP.NET控件的皮肤.如果在主题文件夹中添加了CSS文件,则在页面应用主题时也会自动应用CSS. ...
- 【转】WPF的知识
[-] 闲话WPF之二XAML概述 闲话WPF之五XAML中的类型转换 闲话WPF之十六WPF中的资源 2 闲话WPF之十九WPF中的传递事件 1 闲话WPF之二十WPF中的传递事件 2 闲话WPF之 ...
- 使用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.使 ...
- 高仿Android网易云音乐OkHttp+Retrofit+RxJava+Glide+MVC+MVVM
简介 这是一个使用Java(以后还会推出Kotlin版本)语言,从0开发一个Android平台,接近企业级的项目(我的云音乐),包含了基础内容,高级内容,项目封装,项目重构等知识:主要是使用系统功能, ...
随机推荐
- AutoMapper使用中的问题
指定值只会执行一次 public class MomanBaseProfile : Profile { public MomanBaseProfile() { CreateMap<Request ...
- 【python之路4】循环语句之while
1.while 循环语句 #!/usr/bin/env python # -*- coding:utf-8 -*- import time bol = True while bol: print '1 ...
- [PHP源码阅读]strpos、strstr和stripos、stristr函数
我在github有对PHP源码更详细的注解.感兴趣的可以围观一下,给个star.PHP5.4源码注解.可以通过commit记录查看已添加的注解. strpos mixed strpos ( strin ...
- ECMAScript 6 扫盲
ECMAScript 6 目前基本成为业界标准,它的普及速度比 ES5 要快很多,主要原因是现代浏览器对 ES6 的支持相当迅速,尤其是 Chrome 和 Firefox 浏览器,已经支持 ES6 中 ...
- 惊心动魄的一上午,感谢eclipse 的文件恢复功能
昨晚倒腾了半天android 的程序,夜里三点多了,不争气的笔记本由于太热,突然熄火.话说就在昨天还在想着一定要把东西放到svn上,防止文档找不到或者笔记本丢失带来的严重后果.呵呵,就是这么想着,今天 ...
- 前端开发面试题收集(js部分)
1.问:js中"1"+2+"3"+4 运算结果是? 答: js中,字符串和数值相加,得到的还是字符串,这里的结果1234也是字符串. 2.问:4+3+2+&qu ...
- 高性能JavaScript--快速响应的用户界面(简要学习笔记三)
1.浏览器线程:用于执行JavaScript和更新用户界面的进程被称为“浏览器UI线程”. 2. <1>定时器的出现让出UI线程控制权 setTimeout(),setInterval ...
- 用spm2构建seajs项目的过程
前言 Javascript模块化规范有CommonJs规范,和主要适用于浏览器环境的AMD规范,以及国内的CMD规范,它是SeaJs遵循的模块化规范.因为以前项目中用SeaJs做过前端的模块管理工具, ...
- Hawk 1.2 快速入门2 (大众点评18万美食数据)
本文将讲解通过本软件,获取大众点评的所有美食数据,可选择任一城市,也可以很方便地修改成获取其他生活门类信息的爬虫. 本文将省略原理,一步步地介绍如何在20分钟内完成爬虫的设计,基本不需要编程,还能自动 ...
- Android开发之自定义的ListView(UITableViewController)
Android开发中的ListView, 顾名方法思义,就是表视图.表示图在iOS开发中就是TableView.两者虽然名称不一样,但是其使用方法,使用场景以及该控件的功能都极为相似,都是用来展示大量 ...