Skip to content

chore: remove internal css imports #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Migrating from v0.x to v1.0

### Styling
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.
```javascript
import 'azure-maps-control/dist/atlas.min.css'
```
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ or
yarn add react-azure-maps
```

## Styling
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.
```javascript
import 'azure-maps-control/dist/atlas.min.css'
```

## Documentation

Documentation is available [Documentation](https://react-azure-maps.now.sh)
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-azure-maps",
"version": "0.4.4",
"version": "1.0.0-beta.0",
"description": "React Wrapper for Azure Maps",
"keywords": [
"react",
Expand Down Expand Up @@ -115,13 +115,11 @@
"peerDependencies": {
"azure-maps-control": "2.0.32",
"guid-typescript": "^1.0.9",
"mapbox-gl": "^1.10.0",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"dependencies": {
"azure-maps-control": "2.0.32",
"guid-typescript": "^1.0.9",
"mapbox-gl": "^1.10.0"
"guid-typescript": "^1.0.9"
}
}
14 changes: 8 additions & 6 deletions src/components/AzureMap/AzureMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import atlas from 'azure-maps-control'
import { IAzureMap, IAzureMapsContextProps, MapType } from '../../types'
import { AzureMapsContext } from '../../contexts/AzureMapContext'
import { Guid } from 'guid-typescript'
import 'azure-maps-control/dist/atlas.min.css'
import 'mapbox-gl/src/css/mapbox-gl.css'
import { useCheckRef } from '../../hooks/useCheckRef'
import { createImageSprites } from './useCreateSprites'
import { createMapControls, createMapCustomControls } from './useCreateMapControls'
Expand All @@ -27,9 +25,13 @@ const AzureMap = memo(
styleOptions,
serviceOptions
}: IAzureMap) => {
const { setMapRef, removeMapRef, mapRef, setMapReady, isMapReady } = useContext<
IAzureMapsContextProps
>(AzureMapsContext)
const {
setMapRef,
removeMapRef,
mapRef,
setMapReady,
isMapReady
} = useContext<IAzureMapsContextProps>(AzureMapsContext)
const [mapId] = useState(providedMapId || Guid.create().toString())
useEffect(() => {
if (mapRef) {
Expand Down Expand Up @@ -61,7 +63,7 @@ const AzureMap = memo(
}
}, [serviceOptions])

useCheckRef<MapType, MapType>(mapRef, mapRef, mref => {
useCheckRef<MapType, MapType>(mapRef, mapRef, (mref) => {
mref.events.add('ready', () => {
if (imageSprites) {
createImageSprites(mref, imageSprites)
Expand Down
Loading