Skip to content

Commit

Permalink
Sketch 1.1.0 version. Refs #9
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Dec 10, 2013
1 parent 4f6a06a commit 9106fd7
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 0 deletions.
109 changes: 109 additions & 0 deletions 1.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 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](http://geojson.org/) data standard that
define styles. As such, files implementing `simplestyle` are by
definition valid GeoJSON files and valid [JSON](http://json.org/) files.

```javascript
// COLOR RULES
// Colors can be in short form:
// "#ace"
// or long form
// "#aaccee"
// 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 charecter "a" through "z"
"marker-symbol": "bus",

// OPTIONAL: default "7e7e7e"
// the color or the marker is by default
// a color to which the graphic is tinted
//
// value must follow COLOR RULES
"marker-color": "#fff"

// OPTIONAL: default "f0f0f0"
// the color of a line as part of a polygon, polyline, or
// multigeometry
//
// value must follow COLOR RULES
"stroke": "#f0f0f0"

// OPTIONAL: default 0.6
// 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": 0.6

// 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 "f0f0f0"
// the color of the interior of a polygon
//
// value must follow COLOR RULES
"fill": "#f0f0f0"

// OPTIONAL: default 0.6
// the opacity of the interior of a polygon
//
// value must be a floating point number greater than or equal to
// zero and less or equal to than one
"fill-opacity": 0.6
}
}]
}
```
25 changes: 25 additions & 0 deletions 1.1.0/example.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "FeatureCollection",
"features": [{ "type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0, 0]
},
"properties": {
"marker-shape": "pin",

This comment has been minimized.

Copy link
@jieter

jieter Dec 12, 2013

this is not in the spec?

"marker-size": "medium",
"marker-symbol": "bus",
"marker-color": "#ace"
}
}, {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[0, 0], [10, 10]]
},
"properties": {
"stroke": "#f0f0f0",
"stroke-width": 2
}
}]
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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
Expand Down

0 comments on commit 9106fd7

Please sign in to comment.