Skip to content

Commit ffdbebb

Browse files
Merge pull request #129 from yulinscottkang/css
chore: remove internal css imports
2 parents 61051aa + 802e7eb commit ffdbebb

File tree

5 files changed

+25
-192
lines changed

5 files changed

+25
-192
lines changed

MIGRATION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Migrating from v0.x to v1.0
2+
3+
### Styling
4+
v1.0 removes the internal css import from `azure-maps-control` to accommodate usage in Next.js. You will need to add the following stylesheet to your application manually. The stylesheet is required for the marker, popup and control components in `react-azure-maps` to work properly.
5+
```javascript
6+
import 'azure-maps-control/dist/atlas.min.css'
7+
```

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ or
2020
yarn add react-azure-maps
2121
```
2222

23+
## Styling
24+
Embed the following css to your application. The stylesheet is required for the marker, popup and control components in `react-azure-maps` to work properly.
25+
```javascript
26+
import 'azure-maps-control/dist/atlas.min.css'
27+
```
28+
2329
## Documentation
2430

2531
Documentation is available [Documentation](https://react-azure-maps.now.sh)

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-azure-maps",
3-
"version": "0.4.4",
3+
"version": "1.0.0-beta.0",
44
"description": "React Wrapper for Azure Maps",
55
"keywords": [
66
"react",
@@ -115,13 +115,11 @@
115115
"peerDependencies": {
116116
"azure-maps-control": "2.0.32",
117117
"guid-typescript": "^1.0.9",
118-
"mapbox-gl": "^1.10.0",
119118
"react": "^17.0.2 || ^18.0.0",
120119
"react-dom": "^17.0.2 || ^18.0.0"
121120
},
122121
"dependencies": {
123122
"azure-maps-control": "2.0.32",
124-
"guid-typescript": "^1.0.9",
125-
"mapbox-gl": "^1.10.0"
123+
"guid-typescript": "^1.0.9"
126124
}
127125
}

src/components/AzureMap/AzureMap.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import atlas from 'azure-maps-control'
33
import { IAzureMap, IAzureMapsContextProps, MapType } from '../../types'
44
import { AzureMapsContext } from '../../contexts/AzureMapContext'
55
import { Guid } from 'guid-typescript'
6-
import 'azure-maps-control/dist/atlas.min.css'
7-
import 'mapbox-gl/src/css/mapbox-gl.css'
86
import { useCheckRef } from '../../hooks/useCheckRef'
97
import { createImageSprites } from './useCreateSprites'
108
import { createMapControls, createMapCustomControls } from './useCreateMapControls'
@@ -27,9 +25,13 @@ const AzureMap = memo(
2725
styleOptions,
2826
serviceOptions
2927
}: IAzureMap) => {
30-
const { setMapRef, removeMapRef, mapRef, setMapReady, isMapReady } = useContext<
31-
IAzureMapsContextProps
32-
>(AzureMapsContext)
28+
const {
29+
setMapRef,
30+
removeMapRef,
31+
mapRef,
32+
setMapReady,
33+
isMapReady
34+
} = useContext<IAzureMapsContextProps>(AzureMapsContext)
3335
const [mapId] = useState(providedMapId || Guid.create().toString())
3436
useEffect(() => {
3537
if (mapRef) {
@@ -61,7 +63,7 @@ const AzureMap = memo(
6163
}
6264
}, [serviceOptions])
6365

64-
useCheckRef<MapType, MapType>(mapRef, mapRef, mref => {
66+
useCheckRef<MapType, MapType>(mapRef, mapRef, (mref) => {
6567
mref.events.add('ready', () => {
6668
if (imageSprites) {
6769
createImageSprites(mref, imageSprites)

0 commit comments

Comments
 (0)