forked from openlayers/openlayers
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
20 changed files
with
4,642 additions
and
33 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
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,3 @@ | ||
.map { | ||
background: #f8f4f0; | ||
} |
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,15 @@ | ||
--- | ||
layout: example.html | ||
title: Mapbox Vector Layer | ||
shortdesc: Rendering a layer with a Mapbox-hosted style. | ||
docs: > | ||
The MapboxVector layer allows you to create a layer based on a Mapbox-hosted style using a single | ||
vector source. If your style uses more than one source, use the `source` property to choose a | ||
single vector source. Use the `layers` property if you only want to render a subset of the style's | ||
layers (provided they all share the same source). | ||
tags: "mapbox, studio, vector, tiles" | ||
cloak: | ||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q | ||
value: Your Mapbox access token from https://mapbox.com/ here | ||
--- | ||
<div id="map" class="map"></div> |
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,18 @@ | ||
import Map from '../src/ol/Map.js'; | ||
import MapboxVector from '../src/ol/layer/MapboxVector.js'; | ||
import View from '../src/ol/View.js'; | ||
|
||
const map = new Map({ | ||
target: 'map', | ||
layers: [ | ||
new MapboxVector({ | ||
styleUrl: 'mapbox://styles/mapbox/bright-v9', | ||
accessToken: | ||
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q', | ||
}), | ||
], | ||
view: new View({ | ||
center: [0, 0], | ||
zoom: 2, | ||
}), | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,22 @@ | ||
import Map from '../../../src/ol/Map.js'; | ||
import MapboxVector from '../../../src/ol/layer/MapboxVector.js'; | ||
import View from '../../../src/ol/View.js'; | ||
|
||
new Map({ | ||
layers: [ | ||
new MapboxVector({ | ||
styleUrl: '/data/styles/bright-v9.json', | ||
accessToken: 'test-token', | ||
}), | ||
], | ||
target: 'map', | ||
view: new View({ | ||
center: [1825927.7316762917, 6143091.089223046], | ||
zoom: 15, | ||
}), | ||
}); | ||
|
||
render({ | ||
message: 'Mapbox vector layer renders', | ||
tolerance: 0.025, | ||
}); |
Oops, something went wrong.