Skip to content

Commit

Permalink
docs: update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 24, 2021
1 parent 1f387f7 commit a2e578c
Show file tree
Hide file tree
Showing 24 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"react-router-dom": "5.2.0",
"react-test-renderer": "17.0.2",
"source-map-explorer": "2.5.2",
"tsbb": "3.0.0-rc.5"
"tsbb": "3.0.0-rc.6"
},
"eslintConfig": {
"extends": [
Expand Down
4 changes: 2 additions & 2 deletions src/APILoader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import ReactDOM from 'react-dom';
import { Map, APILoader } from '@uiw/react-baidu-map';

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Map autoLocalCity />
<Map autoLocalCity style={{ height: 350 }} />
</APILoader>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/CanvasLayer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Example = () => {
return (
<>
<button onClick={() => setVisiable(!visiable)}>{visiable ? '隐藏' : '显示'}</button>
<Map zoom={12} widget={['NavigationControl']}>
<Map zoom={12} widget={['NavigationControl']} style={{ height: 350 }}>
<CanvasLayer
ref={canvasLayerRef}
visiable={visiable}
Expand Down Expand Up @@ -57,7 +57,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -116,13 +116,13 @@ const Example = () => {
return (
<>
<button onClick={() => setVisiable(!visiable)}>{visiable ? '隐藏' : '显示'}</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
4 changes: 2 additions & 2 deletions src/Circle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Example = () => {
<button onClick={() => setEnableEditing(!enableEditing)}>{enableEditing ? '取消编辑' : '编辑'}</button>
<button onClick={() => setStrokeOpacity(0.7)}>透明度0.7</button>
<button onClick={() => setStrokeOpacity(0.2)}>透明度0.2</button>
<Map widget={['NavigationControl']}>
<Map widget={['NavigationControl']} style={{ height: 350 }}>
<Circle
ref={circleRef}
visiable={visiable}
Expand All @@ -53,7 +53,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/Control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Example = () => {
const [count, setCount] = useState(0);
const map = useRef(null);
return (
<Map zoom={13} ref={map}>
<Map zoom={13} ref={map} style={{ height: 350 }}>
<Control
ref={(instance) => {
if (instance && instance.control) {
Expand Down Expand Up @@ -63,7 +63,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -105,14 +105,14 @@ const Example = () => {
const { portal } = useControl({ map, children, anchor: BMAP_ANCHOR_TOP_RIGHT });
return (
<>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
{portal}
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
4 changes: 2 additions & 2 deletions src/CopyrightControl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Example = () => {
<button onClick={() => setShow(!show)}>
{show ? '关闭' : '开启'}
</button>
<Map zoom={13} ref={map} widget={['NavigationControl']}>
<Map zoom={13} ref={map} widget={['NavigationControl']} style={{ height: 350 }}>
<CopyrightControl offset={new BMap.Size(10, 30)} anchor={BMAP_ANCHOR_TOP_RIGHT}>
<CopyrightControl.Item bounds={bounds}>
<span style={{ color: 'red', backgroundColor: '#fff', padding: 3 }}>自定义版权只在上海地区可见</span>
Expand All @@ -48,7 +48,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/CurveLine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Example = () => {
<button onClick={() => setEnableEditing(!enableEditing)}>{enableEditing ? '取消编辑' : '编辑'}</button>
<button onClick={() => setStrokeOpacity(0.7)}>透明度0.7</button>
<button onClick={() => setStrokeOpacity(0.2)}>透明度0.2</button>
<Map zoom={4} center="武汉" widget={['NavigationControl']}>
<Map zoom={4} center="武汉" widget={['NavigationControl']} style={{ height: 350 }}>
<CurveLine
ref={curveLineRef}
enableEditing={enableEditing}
Expand All @@ -47,7 +47,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -117,13 +117,13 @@ const Example = () => {
<button onClick={() => setEnableEditing(!enableEditing)}>{enableEditing ? '取消编辑' : '编辑'}</button>
<button onClick={() => setStrokeOpacity(0.7)}>透明度0.7</button>
<button onClick={() => setStrokeOpacity(0.2)}>透明度0.2</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/CustomOverlay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const Demo = () => {
setCount(count + 1);
}
return (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Map widget={['NavigationControl']} zoom={13}>
<Map widget={['NavigationControl']} zoom={13} style={{ height: 350 }}>
<Marker position={{ lng: 121.466008, lat: 31.220001 }} />
<CustomOverlay
ref={markerRef}
Expand Down Expand Up @@ -108,14 +108,14 @@ const Example = () => {

return (
<>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
{portal}
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/DrawingManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const styleOptions = {
const Example = () => {
return (
<>
<Map zoom={4} center="武汉" widget={['NavigationControl']}>
<Map zoom={4} center="武汉" widget={['NavigationControl']} style={{ height: 350 }}>
<DrawingManager
isOpen={true}
enableDrawingTool={true}
Expand All @@ -49,7 +49,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -108,13 +108,13 @@ const Example = () => {

return (
<>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/GeolocationControl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Example = () => {
<button onClick={() => setShow(!show)}>
{show ? '关闭' : '开启'}
</button>
<Map zoom={13}>
<Map zoom={13} style={{ height: 350 }}>
{show && (
<GeolocationControl
onLocationSuccess={(e) => {
Expand Down Expand Up @@ -55,7 +55,7 @@ const Example = () => {
}

ReactDOM.render((
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -91,13 +91,13 @@ const Example = () => {
<button onClick={() => setShow(!show)}>
{show ? '关闭' : '开启'}
</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
);
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
4 changes: 2 additions & 2 deletions src/GroundOverlay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Example = () => {
return (
<>
<button onClick={() => setVisiable(!visiable)}>{visiable ? '隐藏' : '显示'}</button>
<Map center="北京" zoom={11} widget={['NavigationControl']}>
<Map center="北京" zoom={11} widget={['NavigationControl']} style={{ height: 350 }}>
{visiable && (
<GroundOverlay
ref={groundRef}
Expand All @@ -46,7 +46,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
4 changes: 2 additions & 2 deletions src/InfoWindow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ const Example = () => {
<>
<button onClick={() => setIsOpen(!isOpen)}>{isOpen ? '显示' : '隐藏'}</button>
<input value={title} onChange={(e) => setTitle(e.target.value)} />
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => {
return (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/Label/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Example = () => {
<>
<input value={content} onChange={(e) => setContent(e.target.value)} />
<button onClick={() => setVisiable(!visiable)}>{visiable ? '隐藏' : '显示'}</button>
<Map zoom={13} widget={['NavigationControl']}>
<Map zoom={13} widget={['NavigationControl']} style={{ height: 350 }} />
<Label visiable={visiable} content={content} position={{ lng: 121.436256, lat: 31.246926 }}/>
<Label
ref={labelRef}
Expand All @@ -44,7 +44,7 @@ const Example = () => {
}

const Demo = () => (
<div style={{ width: '100%', height: '350px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -88,13 +88,13 @@ const Example = () => {
<button onClick={() => setZoom(counts-1)}>-</button>
<span>{zoom || 15}</span>
<button onClick={() => setZoom(counts+1)}>+</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
4 changes: 2 additions & 2 deletions src/Map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ const Example = () => {
<button onClick={() => setCenter('北京')}>北京</button>
<button onClick={() => setCenter('上海')}>上海</button>
<button onClick={() => setAutoLocalCity(true)}>IP定位</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
)
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
8 changes: 4 additions & 4 deletions src/MapTypeControl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Example = () => {
<button onClick={() => setShow(!show)}>
{show ? '关闭' : '开启'}
</button>
<Map zoom={13}>
<Map zoom={13} style={{ height: 350 }}>
{show && (
<MapTypeControl />
)}
Expand All @@ -58,7 +58,7 @@ const Example = () => {
}

ReactDOM.render((
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down Expand Up @@ -94,13 +94,13 @@ const Example = () => {
<button onClick={() => setShow(!show)}>
{show ? '关闭' : '开启'}
</button>
<div ref={divElm} style={{ height: '100%' }} />
<div ref={divElm} style={{ height: 350 }} />
</>
);
}

const Demo = () => (
<div style={{ width: '100%', height: '300px' }}>
<div style={{ width: '100%' }}>
<APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
<Example />
</APILoader>
Expand Down
Loading

0 comments on commit a2e578c

Please sign in to comment.