mirror of
https://github.com/maputnik/editor.git
synced 2026-02-05 20:20:02 +00:00
This PR aims at updating MapLibre dependencies. The main goal of this update is to allow adding terrain specification to the editor. This requires version 4 of maplibre so currently it will use the pre-release.
39 lines
767 B
JavaScript
39 lines
767 B
JavaScript
import React from 'react';
|
|
import FieldFunction from '../src/components/FieldFunction';
|
|
import latest from '@maplibre/maplibre-gl-style-spec/dist/latest.json'
|
|
|
|
export default {
|
|
title: 'FieldFunction',
|
|
component: FieldFunction,
|
|
};
|
|
|
|
export const Basic = () => {
|
|
const value = {
|
|
"property": "rank",
|
|
"type": "categorical",
|
|
"default": "#222",
|
|
"stops": [
|
|
[
|
|
{"zoom": 6, "value": ""},
|
|
["#777"]
|
|
],
|
|
[
|
|
{"zoom": 10, "value": ""},
|
|
["#444"]
|
|
]
|
|
]
|
|
};
|
|
|
|
return <div style={{width: "360px"}}>
|
|
<FieldFunction
|
|
onChange={() => {}}
|
|
value={value}
|
|
errors={[]}
|
|
fieldName={"Color"}
|
|
fieldType={"color"}
|
|
fieldSpec={latest['paint_fill']['fill-color']}
|
|
/>
|
|
</div>
|
|
};
|
|
|