This repository has been archived by the owner on Jan 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a8c810
commit d24deea
Showing
38 changed files
with
5,001 additions
and
4,824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# LogoControl | ||
|
||
React component that wraps the base library's [LogoControl](https://maplibre.org/maplibre-gl-js/docs/API/classes/LogoControl/) class. | ||
|
||
```tsx | ||
import * as React from 'react'; | ||
import {Map, LogoControl} from '@vis.gl/react-maplibre'; | ||
import 'maplibre-gl/dist/maplibre-gl.css'; | ||
|
||
function App() { | ||
return <Map | ||
initialViewState={{ | ||
longitude: -100, | ||
latitude: 40, | ||
zoom: 3.5 | ||
}} | ||
mapStyle="https://demotiles.maplibre.org/style.json" | ||
> | ||
<LogoControl /> | ||
</Map>; | ||
} | ||
``` | ||
|
||
|
||
## Properties | ||
|
||
### Reactive Properties | ||
|
||
#### `style`: CSSProperties {#style} | ||
|
||
CSS style override that applies to the control's container. | ||
|
||
|
||
### Other Properties | ||
|
||
The properties in this section are not reactive. They are only used when the component first mounts. | ||
|
||
Any [options](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/LogoControlOptions/) supported by the `LogoControl` class, such as | ||
|
||
- `compact` | ||
|
||
Plus the following: | ||
|
||
#### `position`: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' {#position} | ||
|
||
Default: `'top-right'` | ||
|
||
Placement of the control relative to the map. | ||
|
||
|
||
## Source | ||
|
||
[logo-control.ts](https://github.com/visgl/react-maplibre/tree/1.0-release/src/components/logo-control.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# TerrainControl | ||
|
||
React component that wraps the base library's [TerrainControl](https://maplibre.org/maplibre-gl-js/docs/API/classes/TerrainControl/) class. | ||
|
||
```tsx | ||
import * as React from 'react'; | ||
import {Map, MapStyle, TerrainControl} from '@vis.gl/react-maplibre'; | ||
import 'maplibre-gl/dist/maplibre-gl.css'; | ||
|
||
// https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/ | ||
const MAP_STYLE: MapStyle = { | ||
version: 8, | ||
sources: { | ||
osm: { | ||
type: 'raster', | ||
tiles: ['https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'], | ||
tileSize: 256, | ||
attribution: '© OpenStreetMap Contributors', | ||
maxzoom: 19 | ||
}, | ||
terrainSource: { | ||
type: 'raster-dem', | ||
url: 'https://demotiles.maplibre.org/terrain-tiles/tiles.json', | ||
tileSize: 256 | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'osm', | ||
type: 'raster', | ||
source: 'osm' | ||
} | ||
], | ||
terrain: { | ||
source: 'terrainSource', | ||
exaggeration: 1 | ||
}, | ||
sky: {} | ||
}; | ||
|
||
function App() { | ||
return <Map | ||
initialViewState={{ | ||
longitude: -100, | ||
latitude: 40, | ||
zoom: 3.5 | ||
}} | ||
mapStyle={MAP_STYLE} | ||
> | ||
<TerrainControl /> | ||
</Map>; | ||
} | ||
``` | ||
|
||
|
||
## Properties | ||
|
||
### Reactive Properties | ||
|
||
#### `style`: CSSProperties {#style} | ||
|
||
CSS style override that applies to the control's container. | ||
|
||
|
||
### Other Properties | ||
|
||
The properties in this section are not reactive. They are only used when the component first mounts. | ||
|
||
Any [options](https://maplibre.org/maplibre-style-spec/terrain/) supported by the `TerrainControl` class, such as | ||
|
||
- `source` | ||
- `exageration` | ||
|
||
Plus the following: | ||
|
||
#### `position`: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' {#position} | ||
|
||
Default: `'top-right'` | ||
|
||
Placement of the control relative to the map. | ||
|
||
|
||
## Source | ||
|
||
[terrain-control.ts](https://github.com/visgl/react-maplibre/tree/1.0-release/src/components/terrain-control.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
<meta charset='UTF-8' /> | ||
<title>react-maplibre Example</title> | ||
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.css" type="text/css"> | ||
<style> | ||
body { | ||
margin: 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
<meta charset='UTF-8' /> | ||
<title>react-maplibre Example</title> | ||
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://unpkg.com/@maplibre/[email protected]/dist/maplibre-gl-geocoder.css" type="text/css"> | ||
<style> | ||
body { | ||
margin: 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
public/ | ||
.cache/ | ||
.docusaurus/ | ||
build/ | ||
public | ||
.cache | ||
report*.json | ||
build | ||
.docusaurus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
plugins: [ | ||
'version-inline', | ||
// Ensure consistently hashed component classNames between environments (a must for SSR) | ||
'styled-components' | ||
] | ||
plugins: ["styled-components"] | ||
}; |
Oops, something went wrong.