Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiHuebner committed Oct 13, 2023
1 parent b94e347 commit 135500a
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 47 deletions.
81 changes: 45 additions & 36 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,56 @@ description: List of example links run in SolidJS playground

{% tabs %}
{% tab title="Map" %}
* [Static Map](https://stackblitz.com/edit/solid-map-gl-static?embed=1&file=src%2Findex.tsx)
* [Interactive Map](https://stackblitz.com/edit/solid-map-gl-interactive?embed=1&file=src%2Findex.tsx)
* [Change Vector 'Base Map'](https://stackblitz.com/edit/solid-map-gl-vector-base?embed=1&file=src%2Findex.tsx)
* [Toggle Dark Theme Map](https://stackblitz.com/edit/solid-map-gl-dark-theme?embed=1&file=src%2Findex.tsx)
* [Change Projection](https://stackblitz.com/edit/solid-map-gl-projection?embed=1&file=src%2Findex.tsx)
* [Display Mouse Coordinates](https://stackblitz.com/edit/solid-map-gl-mouse?embed=1&file=src%2Findex.tsx)
* [Sync Maps](https://stackblitz.com/edit/solid-map-gl-sync?embed=1&file=src%2Findex.tsx)
* [Swipe Maps](https://stackblitz.com/edit/solid-map-gl-swipe?embed=1&file=src%2Findex.tsx)
* [Map Context](https://stackblitz.com/edit/solid-map-gl-fit-bounds?embed=1&file=src%2Findex.tsx)
* [Use MapLibre](https://stackblitz.com/edit/solid-map-gl-use-maplibre?embed=1&file=src%2Findex.tsx)
* ~~Debug Maps~~
{% endtab %}

- [Static Map](https://stackblitz.com/edit/solid-map-gl-static?embed=1&file=src%2Findex.tsx)
- [Interactive Map](https://stackblitz.com/edit/solid-map-gl-interactive?embed=1&file=src%2Findex.tsx)
- [Change Vector 'Base Map'](https://stackblitz.com/edit/solid-map-gl-vector-base?embed=1&file=src%2Findex.tsx)
- [Toggle Dark Theme Map](https://stackblitz.com/edit/solid-map-gl-dark-theme?embed=1&file=src%2Findex.tsx)
- [Change Projection](https://stackblitz.com/edit/solid-map-gl-projection?embed=1&file=src%2Findex.tsx)
- [Display Mouse Coordinates](https://stackblitz.com/edit/solid-map-gl-mouse?embed=1&file=src%2Findex.tsx)
- [Sync Maps](https://stackblitz.com/edit/solid-map-gl-sync?embed=1&file=src%2Findex.tsx)
- [Swipe Maps](https://stackblitz.com/edit/solid-map-gl-swipe?embed=1&file=src%2Findex.tsx)
- [Map Context](https://stackblitz.com/edit/solid-map-gl-fit-bounds?embed=1&file=src%2Findex.tsx)
- [Use MapLibre](https://stackblitz.com/edit/solid-map-gl-use-maplibre?embed=1&file=src%2Findex.tsx)
- ~~Debug Maps~~
{% endtab %}

{% tab title="Source" %}
* [Add GeoJSON Source](https://stackblitz.com/edit/solid-map-gl-geojson?embed=1&file=src%2Findex.tsx)
* [Add GeoJSON URL Source](https://stackblitz.com/edit/solid-map-gl-url?embed=1&file=src%2Findex.tsx)
* [Updating GeoJSON Source](https://stackblitz.com/edit/solid-map-gl-update?embed=1&file=src%2Findex.tsx)
* [Add Vector Source](https://stackblitz.com/edit/solid-map-gl-vector?embed=1&file=src%2Findex.tsx)
* [Add Raster Source](https://stackblitz.com/edit/solid-map-gl-raster?embed=1&file=src%2Findex.tsx)
* [Change Raster 'Base Map'](https://stackblitz.com/edit/solid-map-gl-toggle-raster?embed=1&file=src%2Findex.tsx)
* [Add Image Source](https://stackblitz.com/edit/solid-map-gl-image-source?embed=1&file=src%2Findex.tsx)
* [Add Image](https://stackblitz.com/edit/solid-map-gl-image?embed=1&file=src%2Findex.tsx)
* [Add Video](https://stackblitz.com/edit/solid-map-gl-video?embed=1&file=src%2Findex.tsx)
{% endtab %}

- [Add GeoJSON Source](https://stackblitz.com/edit/solid-map-gl-geojson?embed=1&file=src%2Findex.tsx)
- [Add GeoJSON URL Source](https://stackblitz.com/edit/solid-map-gl-url?embed=1&file=src%2Findex.tsx)
- [Updating GeoJSON Source](https://stackblitz.com/edit/solid-map-gl-update?embed=1&file=src%2Findex.tsx)
- [Add Vector Source](https://stackblitz.com/edit/solid-map-gl-vector?embed=1&file=src%2Findex.tsx)
- [Add Raster Source](https://stackblitz.com/edit/solid-map-gl-raster?embed=1&file=src%2Findex.tsx)
- [Change Raster 'Base Map'](https://stackblitz.com/edit/solid-map-gl-toggle-raster?embed=1&file=src%2Findex.tsx)
- [Add Image Source](https://stackblitz.com/edit/solid-map-gl-image-source?embed=1&file=src%2Findex.tsx)
- [Add Image](https://stackblitz.com/edit/solid-map-gl-image?embed=1&file=src%2Findex.tsx)
- [Add Video](https://stackblitz.com/edit/solid-map-gl-video?embed=1&file=src%2Findex.tsx)
{% endtab %}

{% tab title="Layer" %}
* [Add Heatmap](https://stackblitz.com/edit/solid-map-gl-heatmap?embed=1&file=src%2Findex.tsx)
* [Add Custom Layer](https://stackblitz.com/edit/solid-map-gl-custom-layer?embed=1&file=src%2Findex.tsx)
* [Dynamic Pattern](https://stackblitz.com/edit/solid-map-gl-pattern?embed=1&file=src%2Findex.tsx)
{% endtab %}

- [Add Heatmap](https://stackblitz.com/edit/solid-map-gl-heatmap?embed=1&file=src%2Findex.tsx)
- [Add Custom Layer](https://stackblitz.com/edit/solid-map-gl-custom-layer?embed=1&file=src%2Findex.tsx)
- [Dynamic Pattern](https://stackblitz.com/edit/solid-map-gl-pattern?embed=1&file=src%2Findex.tsx)
{% endtab %}

{% tab title="Overlay" %}
* [Dynamic Controls / Traffic / Geocoder](https://stackblitz.com/edit/solid-map-gl-controls?embed=1&file=src%2Findex.tsx)
* [Dynamic Marker / Popup](https://stackblitz.com/edit/solid-map-gl-marker-popup?embed=1&file=src/index.tsx)
{% endtab %}

- [Dynamic Controls / Traffic / Geocoder](https://stackblitz.com/edit/solid-map-gl-controls?embed=1&file=src%2Findex.tsx)
- [Dynamic Marker / Popup](https://stackblitz.com/edit/solid-map-gl-marker-popup?embed=1&file=src/index.tsx)
{% endtab %}

{% tab title="3D" %}
* [3D Overlays](https://stackblitz.com/edit/solid-map-gl-3d-overlay?embed=1&file=src%2Findex.tsx)
* [Add Hillshade](https://stackblitz.com/edit/solid-map-gl-hillshade?embed=1&file=src%2Findex.tsx)
* [Add Globe](https://stackblitz.com/edit/solid-map-gl-globe?embed=1&file=src%2Findex.tsx)
* [Query Elevation](https://stackblitz.com/edit/solid-map-gl-query-elevation?embed=1&file=src%2Findex.tsx)
* ~~Camera Transition~~
{% endtab %}
{% endtabs %}

- [3D Overlays](https://stackblitz.com/edit/solid-map-gl-3d-overlay?embed=1&file=src%2Findex.tsx)
- [Add Hillshade](https://stackblitz.com/edit/solid-map-gl-hillshade?embed=1&file=src%2Findex.tsx)
- [Add Globe](https://stackblitz.com/edit/solid-map-gl-globe?embed=1&file=src%2Findex.tsx)
- [Query Elevation](https://stackblitz.com/edit/solid-map-gl-query-elevation?embed=1&file=src%2Findex.tsx)
- [Add 3D Layer with BabylonJS](https://stackblitz.com/edit/solid-map-gl-3d-babylon?embed=1&file=src%2Findex.tsx)
- [Add 3D Layer with ThreeJS](https://stackblitz.com/edit/solid-map-gl-3d-three?embed=1&file=src%2Findex.tsx)
- [Add 3D Layer with ThreeBox](https://stackblitz.com/edit/solid-map-gl-3d-threebox?embed=1&file=src%2Findex.tsx)

- ~~Camera Transition~~
{% endtab %}
{% endtabs %}
23 changes: 12 additions & 11 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ layout: landing

#### Roadmap

* [x] Basic Mapbox GL Functionality
* [x] Include Map Controls
* [x] Include Fog, Sky, and Terrain
* [x] Include Popup and Markers
* [x] Minify bundle & reduce size
* [x] Add basemap switching
* [x] Include event handling
* [x] Sync Maps
* [x] Add MapLibre support
* [ ] Add draw functionality
* [ ] Add debug console
- [x] Basic Mapbox GL Functionality
- [x] Include Map Controls
- [x] Include Fog, Sky, and Terrain
- [x] Include Popup and Markers
- [x] Minify bundle & reduce size
- [x] Add basemap switching
- [x] Include event handling
- [x] Sync Maps
- [x] Add MapLibre support
- [x] Add draw functionality
- [x] Add 3D Layer
- [ ] Add debug console
54 changes: 54 additions & 0 deletions src/components/Layer3D/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: Layer 3D Component
---

# Layer3D

## Props

| Name | Type | Description |
| ------------ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| origin | object [x: number, y:number, z:number] | The origin of the 3D model |
| babylon\* | boolean | Flag to indicate using [BabylonJS](https://www.babylonjs.com/) otherwise [ThreeJS](https://threejs.org/) library |
| defaultLight | boolean | Default light for the scene |
| onAdd | function | Function to create the scene after layer is added |
| onRender | function | Function to implement functionallity on each render cycle |

_\*required_

## Example

```jsx
import { Component, createSignal } from "solid-js";
import MapGL, { Viewport, Layer3D } from "solid-map-gl";
import 'mapbox-gl/dist/mapbox-gl.css';
import { SceneLoader } from '@babylonjs/core/Loading';
import '@babylonjs/loaders';

const [viewport, setViewport] = createSignal({
center: [148.9819, -35.3981],
zoom: 18,
pitch: 60,
} as Viewport);

const App: Component = () => (
<MapGL
options={{ style: 'mb:light', antialias: true }}
viewport={viewport()}
onViewportChange={(evt: Viewport) => setViewport(evt)}
>
<Layer3D
babylon
defaultLight
origin={[148.9819, -35.39847]}
onAdd={(scene) => {
SceneLoader.LoadAssetContainerAsync(
'https://docs.mapbox.com/mapbox-gl-js/assets/34M_17/',
'34M_17.gltf',
scene
).then((modelContainer: any) => modelContainer.addAllToScene());
}}
/>
</MapGL>
);
```

0 comments on commit 135500a

Please sign in to comment.