React Wrapper for azure-maps-control
Перейти к файлу
Scott Kang 7cd7bb199c chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
.circleci feat: change the way of build the package and add preview (#88) 2021-03-26 17:52:03 +01:00
__mocks__ feat: Vector Tile Source Support (#90) 2021-04-13 22:01:12 +02:00
assets feat: Vector Tile Source Support (#90) 2021-04-13 22:01:12 +02:00
preview chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
src chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
tools chore: Initialize package 2019-10-21 14:23:29 +02:00
.babelrc feat: change the way of build the package and add preview (#88) 2021-03-26 17:52:03 +01:00
.editorconfig chore: Initialize package 2019-10-21 14:23:29 +02:00
.gitignore feat: change the way of build the package and add preview (#88) 2021-03-26 17:52:03 +01:00
.prettierrc chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
.travis.yml chore: Initialize package 2019-10-21 14:23:29 +02:00
LICENSE feat: add docs, fix licence (#25) 2020-02-14 09:55:46 +01:00
README.md add credits to header, replace WiredSolutions references 2021-09-30 18:13:51 +08:00
_config.yml Set theme jekyll-theme-cayman 2020-02-11 23:57:25 +01:00
babel.config.js feat: change the way of build the package and add preview (#88) 2021-03-26 17:52:03 +01:00
commitlint.config.js chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
jest.config.js feat: add circle ci config 2020-03-08 12:06:38 +01:00
package.json chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00
rollup.config.js fix: remove source maps and peer-install-cli (#89) 2021-03-29 10:58:38 +02:00
tsconfig.json Add test cases to AzureMap component, useCreateControls helper hooks (#41) 2020-03-07 20:17:39 +01:00
tslint.json chore: Initialize package 2019-10-21 14:23:29 +02:00
yarn.lock chore(deps): upgrade devDependencies to react 18 2022-08-01 22:28:26 +08:00

README.md

React-Azure-Maps

This project is community-driven initiative originally created by amazing @psrednicki, @msasinowski and @tbajda and is now maintained by the Azure Maps team.

npm npm license

React Azure Maps is a react wrapper for Azure Maps. The whole library is written in typescript and uses React 16.8+

Installation

Use the package manager npm or yarn

npm install react-azure-maps

or

yarn add react-azure-maps

Documentation

Documentation is available Documentation

Generated documentation from typedoc is available Documentation

Compatibility with azure-maps-controls

0.2.0 - 2.0.32
0.1.4 - 2.0.31
0.1.3 - 2.0.25

Playground

React Azure Maps have a fully documented Playground Package that implements a lot of features from Azure Maps Code Samples. If you implement new usage of the map and want to be contributor just create a PR.

Library Implementation Details

For typescript integration and core functionalities, this library uses the newest version of Azure Maps Control. The library is implemented under the hood on Contexts and uses all benefits of new react features, like new context API, hooks, etc. Across the whole library, there are three main references that depend on the basic Azure Maps API

MapReference which is stored and implemented in

AzureMapsProvider

DataSourceReference which is stored and implemented in

AzureMapDataSourceProvider

LayerReference which is stored and implemented in

AzureMapLayerProvider

If you want to directly make some changes in the above refs just use one of these contexts and feel free to use it any way you want. The library implements a lot of ready to use components like AzureMapFeature, AzureMapHTMLMarker, AzureMapPopup

Basic Usage

import React from 'react'
import {AzureMap, AzureMapsProvider, IAzureMapOptions} from 'react-azure-maps'
import {AuthenticationType} from 'azure-maps-control'

const option: IAzureMapOptions = {
    authOptions: {
        authType: AuthenticationType.subscriptionKey,
        subscriptionKey: '' // Your subscription key
    },
}

const DefaultMap: React.FC = () => (
  <AzureMapsProvider>
    <div style={{ height: '300px' }}>
      <AzureMap options={option} />
    </div>
  </AzureMapsProvider>
);

export default DefaultMap

Local development with Playground Package

If you want to do some local development using Playground Package with local link to the package, you need to make the following steps:

- run yarn watch in `react-azure-maps` package
- run yarn link in `react-azure-maps` package
- go to the `azure-maps-playground` or any other folder or repository and run `yarn link "react-azure-maps"`

Code coverage

Alt text

Contributing

Pull requests are welcomed. For major changes, please open an issue first to discuss what you would like to change.

Creators


psrednicki


msasinowski

tbajda

License

MIT