Skip to content

Commit

Permalink
Merge pull request #153 from yulinscottkang/v1/sdk-upgrade
Browse files Browse the repository at this point in the history
chore: upgrade azure-maps-control to v3
  • Loading branch information
yulinscottkang authored Apr 25, 2023
2 parents ffdbebb + d847329 commit 2772f11
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 233 deletions.
19 changes: 0 additions & 19 deletions .circleci/config.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Generated documentation from typedoc is available [Documentation](https://azure.
## Compatibility with azure-maps-controls

```
1.0.0 - 3.0.0
0.2.0 - 2.0.32
0.1.4 - 2.0.31
0.1.3 - 2.0.25
Expand Down Expand Up @@ -74,8 +75,7 @@ The library implements a lot of ready to use components like `AzureMapFeature, A

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

const option: IAzureMapOptions = {
authOptions: {
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-azure-maps",
"version": "1.0.0-beta.0",
"version": "1.0.0-beta.1",
"description": "React Wrapper for Azure Maps",
"keywords": [
"react",
Expand All @@ -13,9 +13,14 @@
"maps",
"react-azure-maps"
],
"source": "src/react-azure-maps.ts",
"module": "dist/react-azure-maps.es5.js",
"typings": "dist/types/react-azure-maps.d.ts",
"types": "dist/types/react-azure-maps.d.ts",
"exports": {
".": {
"import": "./dist/react-azure-maps.es5.js",
"types": "./dist/types/react-azure-maps.d.ts"
}
},
"files": [
"dist"
],
Expand Down Expand Up @@ -113,13 +118,13 @@
"typescript": "^4.1.2"
},
"peerDependencies": {
"azure-maps-control": "2.0.32",
"azure-maps-control": "^3.0.0-preview.6",
"guid-typescript": "^1.0.9",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"dependencies": {
"azure-maps-control": "2.0.32",
"azure-maps-control": "^3.0.0-preview.6",
"guid-typescript": "^1.0.9"
}
}
7 changes: 2 additions & 5 deletions src/components/AzureMap/useCreateMapControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import atlas, {
ZoomControlOptions
} from 'azure-maps-control'



export const createMapControls = (mapRef: MapType, controls: IAzureMapControls[]) => {
controls.forEach((control: IAzureMapControls) => {
const { controlName, options, controlOptions } = control
mapRef.controls.add(
createControl(controlName, controlOptions) as atlas.ControlBase,
createControl(controlName, controlOptions) as atlas.control.ControlBase,
options as ControlOptions
)
})
Expand All @@ -23,7 +21,7 @@ export const createMapControls = (mapRef: MapType, controls: IAzureMapControls[]
export const createControl = (
type: string,
options?: ControlOptions
): atlas.ControlBase | undefined => {
): atlas.control.ControlBase | undefined => {
switch (type) {
case 'CompassControl':
return new atlas.control.CompassControl(options as CompassControlOptions)
Expand All @@ -50,4 +48,3 @@ export const createMapCustomControls = (
mapRef.controls.add(control, controlOptions)
})
}

1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,4 @@ export type AzureDataLineString = atlas.data.LineString
export type AzureDataPosition = atlas.data.Position
export type ControlOptions = atlas.ControlOptions
export type AzureSetCameraOptions = ((CameraOptions | CameraBoundsOptions) & AnimationOptions) | any
export { AuthenticationType } from 'azure-maps-control'
Loading

0 comments on commit 2772f11

Please sign in to comment.