2015-01-30 18:17:29 +08:00
|
|
|
# 1. Purpose
|
|
|
|
|
|
|
|
This specification describes an extension for
|
|
|
|
[MapConfig 1.3.0](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-1.3.0.md) version.
|
|
|
|
|
|
|
|
|
|
|
|
# 2. Changes over specification
|
|
|
|
|
2016-02-19 02:15:28 +08:00
|
|
|
This extension introduces a new layer type so it's possible to use a Named Map by its name as a layer.
|
2015-01-30 18:17:29 +08:00
|
|
|
|
|
|
|
## 2.1 Named layers definition
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
{
|
|
|
|
// REQUIRED
|
|
|
|
// string, `named` is the only supported value
|
|
|
|
type: "named",
|
|
|
|
|
|
|
|
// REQUIRED
|
|
|
|
// object, set `named` map layers configuration
|
|
|
|
options: {
|
|
|
|
|
|
|
|
// REQUIRED
|
2016-02-19 02:15:28 +08:00
|
|
|
// string, the name for the Named Map to use
|
2015-01-30 18:17:29 +08:00
|
|
|
name: "world_borders",
|
|
|
|
|
|
|
|
// OPTIONAL
|
2016-02-19 02:15:28 +08:00
|
|
|
// object, the replacement values for the Named Map's template placeholders
|
2015-01-30 18:17:29 +08:00
|
|
|
// See https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md#instantiate-1 for more details
|
|
|
|
config: {
|
|
|
|
"color": "#000"
|
|
|
|
},
|
|
|
|
|
|
|
|
// OPTIONAL
|
2016-02-19 02:15:28 +08:00
|
|
|
// string array, the authorized tokens in case the Named Map has auth method set to `token`
|
2015-01-30 18:17:29 +08:00
|
|
|
// See https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md#named-maps-1 for more details
|
|
|
|
auth_tokens: [
|
|
|
|
"token1",
|
|
|
|
"token2"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## 2.2 Limitations
|
|
|
|
|
2015-01-30 18:27:16 +08:00
|
|
|
1. A Named Map will not allow to have `named` type layers inside their templates layergroup's layers definition.
|
|
|
|
2. A `named` layer does not allow Named Maps form other accounts, it's only possible to use Named Maps from the very
|
|
|
|
same user account.
|
2015-01-30 18:17:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
# History
|
|
|
|
|
|
|
|
## 1.0.0
|
|
|
|
|
|
|
|
- Initial version
|