Skip to content

Commit c2eb1af

Browse files
Merge pull request #106 from Chia-Chi-Shen/storybook
Update react-azure-maps to 1.0.2
2 parents a059100 + 452efc4 commit c2eb1af

File tree

4 files changed

+75
-10
lines changed

4 files changed

+75
-10
lines changed

package-lock.json

Lines changed: 18 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dependencies": {
66
"azure-maps-control": "^3.3.0",
77
"react": "^18.2.0",
8-
"react-azure-maps": "^1.0.0",
8+
"react-azure-maps": "^1.0.2",
99
"react-dom": "^18.2.0",
1010
"react-router-dom": "^6.3.0"
1111
},

src/stories/BasicUsage/MapControls/MapControl.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,50 @@ import {
130130
]}
131131
/>
132132
</AzureMapsProvider>;
133+
`}/>
134+
135+
## Scale Control
136+
137+
<MapControl controls={[controls[6]]}/>
138+
<Source code={`
139+
import {
140+
ControlOptions,
141+
AzureMapsProvider,
142+
AzureMap,
143+
} from 'react-azure-maps';
144+
145+
<AzureMapsProvider>
146+
<AzureMap
147+
options={your_options}
148+
controls={[
149+
{
150+
controlName: 'ScaleControl',
151+
options: { position: 'bottom-left' } as ControlOptions,
152+
},
153+
]}
154+
/>
155+
</AzureMapsProvider>;
156+
`}/>
157+
158+
## Fullscreen Control
159+
160+
<MapControl controls={[controls[7]]}/>
161+
<Source code={`
162+
import {
163+
ControlOptions,
164+
AzureMapsProvider,
165+
AzureMap,
166+
} from 'react-azure-maps';
167+
168+
<AzureMapsProvider>
169+
<AzureMap
170+
options={your_options}
171+
controls={[
172+
{
173+
controlName: 'FullscreenControl',
174+
options: { position: 'top-right' } as ControlOptions,
175+
},
176+
]}
177+
/>
178+
</AzureMapsProvider>;
133179
`}/>

src/stories/BasicUsage/MapControls/MapControl.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ export const controls: IAzureMapControls[] = [
3636
controlOptions: {},
3737
options: { position: 'bottom-left' } as ControlOptions,
3838
},
39+
{
40+
controlName: 'ScaleControl',
41+
controlOptions: {},
42+
options: { position: 'bottom-left' } as ControlOptions,
43+
},
44+
{
45+
controlName: 'FullscreenControl',
46+
controlOptions: {},
47+
options: { position: 'top-right' } as ControlOptions,
48+
}
3949
];
4050

4151
const MapControl = ({ controls }: ControlProps) => {

0 commit comments

Comments
 (0)