From 878b65629c92e56319857f6147637d38860f4e77 Mon Sep 17 00:00:00 2001 From: ambientlight Date: Wed, 14 Apr 2021 21:16:29 +0800 Subject: [PATCH] feat: drawing tools example --- src/examples/DrawingTools.tsx | 59 +++++++++++++++++++++++++++++++++++ src/examples/examplesList.tsx | 6 ++++ 2 files changed, 65 insertions(+) create mode 100644 src/examples/DrawingTools.tsx diff --git a/src/examples/DrawingTools.tsx b/src/examples/DrawingTools.tsx new file mode 100644 index 0000000..f47ae88 --- /dev/null +++ b/src/examples/DrawingTools.tsx @@ -0,0 +1,59 @@ +import React from "react"; + +import { AzureMap, AzureMapsProvider, AzureMapDrawingManagerProvider, AzureMapFeature, AzureMapDrawingLayerProvider, IAzureMapOptions } from 'react-azure-maps'; +import { AuthenticationType } from 'azure-maps-control'; +import { key } from "../key"; +import { wrapperStyles } from "./RouteExample"; + +const styles = { + map: { + height: 600, + marginBottom: 50, + }, +}; + +const option: IAzureMapOptions = { + center: [-122.33, 47.6], + zoom: 12, + authOptions: { + authType: AuthenticationType.subscriptionKey, + subscriptionKey: key, + }, +}; + +const drawingOptions = { + toolbar: { + position: 'top-right', + style: 'dark', + } +}; + +const DrawingTools: React.FC = () => ( +
+ +
+ + + + + + + + + + +
+
+
+); + +export default DrawingTools; \ No newline at end of file diff --git a/src/examples/examplesList.tsx b/src/examples/examplesList.tsx index 84c0408..aba8ed5 100644 --- a/src/examples/examplesList.tsx +++ b/src/examples/examplesList.tsx @@ -19,6 +19,7 @@ import ChangeOptionsWrapper from './Options/ChangeOptionsWrapper'; import MapWrapper from './MapRef/MapWrapper'; import Building3d from './Buildings3D'; import CustomTrafficVectorDatasourceExample from './CustomTrafficVectorDatasourceExample'; +import DrawingTools from './DrawingTools'; export type MapExampleItem = { name: string; @@ -138,5 +139,10 @@ export const examplesList: MapExampleItem[] = [ name: 'Vector Tile Datasource Traffic', component: CustomTrafficVectorDatasourceExample, path: '/custom-traffic' + }, + { + name: 'Drawing Tools', + component: DrawingTools, + path: '/drawing-tools', } ];