Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
feat(mapbox): added the possibility to load geojson file
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-pogor committed Aug 9, 2021
1 parent 9f84d2f commit d2fd6d7
Show file tree
Hide file tree
Showing 10 changed files with 9,302 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/js/theme.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/theme.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/lib/simple-icons/icons/elsevier.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ The `mapbox` shortcode has the following named parameters to use Mapbox GL JS:

Height of the map, default value is `20rem`.

- **properties** _[optional]_

GeoJSON sources and the layers of the map.

Example simple `mapbox` input:

```markdown
Expand All @@ -983,6 +987,16 @@ The rendered output looks like this:

{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/navigation-preview-day-v4?optimize=true" "mapbox://styles/mapbox/navigation-preview-night-v4?optimize=true" >}}

Example `mapbox` input with the GetJSON data:

```markdown
{{</* mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" */>}}
```

The rendered output looks like this:

{{< mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" >}}

## 8 music

The `music` shortcode embeds a responsive music player based on [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,10 @@ The `mapbox` shortcode has the following named parameters to use Mapbox GL JS:

Height of the map, default value is `20rem`.

- **properties** _[optional]_

GeoJSON sources and the layers of the map.

Example simple `mapbox` input:

```markdown
Expand All @@ -988,6 +992,16 @@ The rendered output looks like this:

{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/navigation-preview-day-v4?optimize=true" "mapbox://styles/mapbox/navigation-preview-night-v4?optimize=true" >}}

Example `mapbox` input with the GetJSON data:

```markdown
{{</* mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" */>}}
```

The rendered output looks like this:

{{< mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" >}}

## 8 music

The `music` shortcode embeds a responsive music player based on [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,10 @@ data = [

地图的高度, 默认值是 `20rem`.

- **properties** _[optional]_

GeoJSON sources and the layers of the map.

一个简单的 `mapbox` 示例:

```markdown
Expand All @@ -986,6 +990,16 @@ data = [

{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/streets-zh-v1?optimize=true" >}}

Example `mapbox` input with the GetJSON data:

```markdown
{{</* mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" */>}}
```

The rendered output looks like this:

{{< mapbox lng=28.836 lat=47.021 zoom=8 marked=false properties="/static/features-layers.json" >}}

## 8 music

`music` shortcode 基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS) 提供了一个内嵌的响应式音乐播放器.
Expand Down
22 changes: 22 additions & 0 deletions exampleSite/static/features-layers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"sources": [
{
"id": "logo",
"properties": {
"type": "geojson",
"data": "/features.geojson"
}
}
],
"layers": [
{
"id": "logo-layer",
"type": "fill",
"source": "logo",
"paint": {
"fill-color": ["coalesce", ["get", "fill"], "#005c7c"],
"fill-opacity": 0.5
}
}
]
}
Loading

0 comments on commit d2fd6d7

Please sign in to comment.