diff --git a/src/examples/DrawingTool/DrawingTool.tsx b/src/examples/DrawingTool/DrawingTool.tsx new file mode 100644 index 0000000..19f0bd0 --- /dev/null +++ b/src/examples/DrawingTool/DrawingTool.tsx @@ -0,0 +1,85 @@ +import React, { useState } from 'react'; +import { + AzureMap, + AzureMapDataSourceProvider, + AzureMapDrawingManagerProvider, + AzureMapFeature, + AzureMapLayerProvider, + AzureMapsProvider, + IAzureMapOptions, +} from 'react-azure-maps'; +import { AuthenticationType } from 'azure-maps-control'; +import { key } from '../../key'; +import { control, drawing } from 'azure-maps-drawing-tools'; +import Description from '../../Layout/Description'; +import { Button } from '@material-ui/core'; +import { wrapperStyles } from '../Options/ChangeOptionsWrapper'; + +const option: IAzureMapOptions = { + authOptions: { + authType: AuthenticationType.subscriptionKey, + subscriptionKey: key, + }, +}; + +const drawingOptions = { + toolbar: new control.DrawingToolbar({ + position: 'top-right', + style: 'dark', + }), +}; + +const mode = { + mode: drawing.DrawingMode.drawPolygon, +}; + +const DrawingTool: React.FC = () => { + const [options, setOptions] = useState(drawingOptions); + return ( +
+ Change options in child +
+ +
+ +
+ + + { + console.log('Data on source added', e); + }, + }} + id={'DrawingTool AzureMapDataSourceProvider'} + options={{}} + > + + + + + +
+
+ +
+ + + +
+
+
+ ); +}; +export default DrawingTool; diff --git a/src/examples/examplesList.tsx b/src/examples/examplesList.tsx index 6561759..8082d92 100644 --- a/src/examples/examplesList.tsx +++ b/src/examples/examplesList.tsx @@ -18,6 +18,7 @@ import TrafficOptionsExample from './TrafficOptions'; import ChangeOptionsWrapper from './Options/ChangeOptionsWrapper'; import MapWrapper from './MapRef/MapWrapper'; import Building3d from "./Buildings3D"; +import DrawingTool from "./DrawingTool/DrawingTool"; export type MapExampleItem = { name: string; @@ -38,6 +39,11 @@ export const examplesList: MapExampleItem[] = [ component: MapWrapper, path: '/map-ref-example', }, + { + name: 'Drawing Tools', + component: DrawingTool, + path: '/drawing-tools', + }, { name: 'Layers', component: AzureLayer,