Skip to content

Commit d377ba8

Browse files
committed
docs: ✏️ add basic usage docs
1 parent 37fcddd commit d377ba8

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

docs/basic-usage.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```jsx
2+
import React from 'react';
3+
import MapGL from '@urbica/react-map-gl';
4+
import Draw from '@urbica/react-map-gl-draw';
5+
6+
<MapGL
7+
style={{ width: "100%", height: "400px" }}
8+
mapStyle="mapbox://styles/mapbox/light-v9"
9+
accessToken={MAPBOX_ACCESS_TOKEN}
10+
latitude={37.78}
11+
longitude={-122.41}
12+
zoom={11}
13+
>
14+
<Draw />
15+
</MapGL>
16+
```
File renamed without changes.

styleguide.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,25 @@ const path = require('path');
22
const webpack = require('webpack');
33

44
module.exports = {
5+
title: 'Urbica React Map GL Draw',
6+
moduleAliases: {
7+
'@urbica/react-map-gl-draw': path.resolve(__dirname, 'src')
8+
},
59
require: [path.resolve(__dirname, 'styleguide.setup.js')],
10+
sections: [
11+
{
12+
name: 'Examples',
13+
components: () => [
14+
'docs/basic-usage.md'
15+
],
16+
exampleMode: 'expand'
17+
},
18+
{
19+
name: 'Props',
20+
components: 'src/components/**/index.js',
21+
usageMode: 'expand'
22+
}
23+
],
624
dangerouslyUpdateWebpackConfig: (webpackConfig) => {
725
const envPlugin = new webpack.EnvironmentPlugin(['MAPBOX_ACCESS_TOKEN']);
826
webpackConfig.plugins.push(envPlugin);

0 commit comments

Comments
 (0)