Skip to content

Commit 2772f11

Browse files
Merge pull request #153 from yulinscottkang/v1/sdk-upgrade
chore: upgrade azure-maps-control to v3
2 parents ffdbebb + d847329 commit 2772f11

File tree

6 files changed

+254
-233
lines changed

6 files changed

+254
-233
lines changed

.circleci/config.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Generated documentation from typedoc is available [Documentation](https://azure.
3535
## Compatibility with azure-maps-controls
3636

3737
```
38+
1.0.0 - 3.0.0
3839
0.2.0 - 2.0.32
3940
0.1.4 - 2.0.31
4041
0.1.3 - 2.0.25
@@ -74,8 +75,7 @@ The library implements a lot of ready to use components like `AzureMapFeature, A
7475

7576
```javascript
7677
import React from 'react'
77-
import {AzureMap, AzureMapsProvider, IAzureMapOptions} from 'react-azure-maps'
78-
import {AuthenticationType} from 'azure-maps-control'
78+
import {AzureMap, AzureMapsProvider, IAzureMapOptions, AuthenticationType} from 'react-azure-maps'
7979

8080
const option: IAzureMapOptions = {
8181
authOptions: {

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-azure-maps",
3-
"version": "1.0.0-beta.0",
3+
"version": "1.0.0-beta.1",
44
"description": "React Wrapper for Azure Maps",
55
"keywords": [
66
"react",
@@ -13,9 +13,14 @@
1313
"maps",
1414
"react-azure-maps"
1515
],
16-
"source": "src/react-azure-maps.ts",
1716
"module": "dist/react-azure-maps.es5.js",
18-
"typings": "dist/types/react-azure-maps.d.ts",
17+
"types": "dist/types/react-azure-maps.d.ts",
18+
"exports": {
19+
".": {
20+
"import": "./dist/react-azure-maps.es5.js",
21+
"types": "./dist/types/react-azure-maps.d.ts"
22+
}
23+
},
1924
"files": [
2025
"dist"
2126
],
@@ -113,13 +118,13 @@
113118
"typescript": "^4.1.2"
114119
},
115120
"peerDependencies": {
116-
"azure-maps-control": "2.0.32",
121+
"azure-maps-control": "^3.0.0-preview.6",
117122
"guid-typescript": "^1.0.9",
118123
"react": "^17.0.2 || ^18.0.0",
119124
"react-dom": "^17.0.2 || ^18.0.0"
120125
},
121126
"dependencies": {
122-
"azure-maps-control": "2.0.32",
127+
"azure-maps-control": "^3.0.0-preview.6",
123128
"guid-typescript": "^1.0.9"
124129
}
125130
}

src/components/AzureMap/useCreateMapControls.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import atlas, {
88
ZoomControlOptions
99
} from 'azure-maps-control'
1010

11-
12-
1311
export const createMapControls = (mapRef: MapType, controls: IAzureMapControls[]) => {
1412
controls.forEach((control: IAzureMapControls) => {
1513
const { controlName, options, controlOptions } = control
1614
mapRef.controls.add(
17-
createControl(controlName, controlOptions) as atlas.ControlBase,
15+
createControl(controlName, controlOptions) as atlas.control.ControlBase,
1816
options as ControlOptions
1917
)
2018
})
@@ -23,7 +21,7 @@ export const createMapControls = (mapRef: MapType, controls: IAzureMapControls[]
2321
export const createControl = (
2422
type: string,
2523
options?: ControlOptions
26-
): atlas.ControlBase | undefined => {
24+
): atlas.control.ControlBase | undefined => {
2725
switch (type) {
2826
case 'CompassControl':
2927
return new atlas.control.CompassControl(options as CompassControlOptions)
@@ -50,4 +48,3 @@ export const createMapCustomControls = (
5048
mapRef.controls.add(control, controlOptions)
5149
})
5250
}
53-

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,4 @@ export type AzureDataLineString = atlas.data.LineString
340340
export type AzureDataPosition = atlas.data.Position
341341
export type ControlOptions = atlas.ControlOptions
342342
export type AzureSetCameraOptions = ((CameraOptions | CameraBoundsOptions) & AnimationOptions) | any
343+
export { AuthenticationType } from 'azure-maps-control'

0 commit comments

Comments
 (0)