-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'publisher-production' (#8305)
* Set default thumbnail for examples page for development (#8025) * Set default thumbnail * Add a little guidance about creating example images * creates placeholder.png * v0.54.0-beta.1 (#8084) * CP removeFeatureState fix (#8090) * Empty out features whose states have been removed instead of removing the feature object. This allows updating the buffers for features whose state has been removed, but also requires keep track of previously removed features. * Update Changelog * v0.54.0 (#8115) * Example for `fill-pattern` (#8022) * move docs dependencies to dev (#8121) (#8129) * Mapbox-gl-geocoder v4 examples (#8053) * add geocoder custom render example * language localize example * Update marker demo to use built-in marker function * remove proximity bias for gl-geocoder example because this is now default behavior * update point from geocode demo to set custom marker color * update examples to use new mapbox-gl-geocoder API options * lint new examples * Update examples to gl-geocoder 4.0.0 api * Options should be added to the geocoder, not the map * lint examples * remove templating syntax * lint fixes * @katydecorah 's code review fixes * Studio does support rtl plugin (#8135) * Update comment for setRTLTextPlugin (#8143) * update comment for setRTLTextPlugin * clarify wording in example * update one more frame after canvas source paused (#8130) (#8163) * update one more frame after canvas source paused Calling `canvasSource.pause()` lets us know we can stop pulling in updates from it. Since it is possible that changes were made to the canvas source since the last render we should pull in one more update before stopping. This also lets you call play and pause immediately to render just one frame: ctx.fillRect(10, 10, 50, 50); canvasSource.play(); canvasSource.pause(); * add test * don't render changes made after canvasSource.pause() * optimize * optimize * Bugfix - removeFeatureState fails with target.id === 0 (#8150) (#8164) * Fix an edge case where 0 target.id would fail to clear the feature state * Check for number & string explicitly * Add tests for 0 feature ID * Fix logical check * v0.54.0-beta.2 (#8166) * [docs] meta updates for search (#8142) * update docs-page-shell, update page-shell; update page meta * Update react-page-shell.js * remove contentType from examples page * Update react-page-shell.js * Update react-page-shell.js * [docs] token refactor in docs-page-shell (#8174) * Update page-shell-script.js * do not force production page shell * remove hardcoded token from example, add unit test to look for access token in example html files * [docs] token refactor in docs-page-shell (#8174) (#8181) * Update page-shell-script.js * do not force production page shell * remove hardcoded token from example, add unit test to look for access token in example html files * Fix disappearing controls in Safari 12+ (#8193) (#8194) * workaround for a Safari 12 bug with disappearing controls * fix css lint * v0.54.0 (take two) (#8184) * v0.54.0 * update changelog once more * fix imagery endpoint on WMS example (#8203) * [email protected] (#8212) * [docs] add trailing slash to `pathname` so resolved URL matches the canonical (#8228) * Update documentation.yml (#8230) * update mapbox-gl-geocoder to v4.3.0 (#8231) * @mapbox/mapbox gl style [email protected] (#8264) * Prepare @mapbox/[email protected] * Add changelog of relevant items * Add sku token to Mapbox API tile requests (#14) (#8276) * v1.0.0 (#8277) * [docs] update docs-page-shell (#8254) * fix pathname * Update react-page-shell.js
- Loading branch information
Anjana Sofia Vakil
authored
May 30, 2019
1 parent
a67c213
commit 884db58
Showing
46 changed files
with
444 additions
and
143 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,49 @@ | ||
<div id='map'></div> | ||
|
||
<script> | ||
var map = new mapboxgl.Map({ | ||
container: 'map', | ||
style: 'mapbox://styles/mapbox/streets-v9', | ||
zoom: 1 | ||
}); | ||
|
||
map.on('load', function() { | ||
// Add GeoJSON data | ||
map.addSource('source', { | ||
"type": "geojson", | ||
"data": { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [[ | ||
[-30, -25], | ||
[-30, 35], | ||
[30, 35], | ||
[30, -25], | ||
[-30, -25] | ||
]] | ||
} | ||
} | ||
}); | ||
|
||
// Load an image to use as the pattern | ||
map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/64px-Cat_silhouette.svg.png', function(err, image) { | ||
// Throw an error if something went wrong | ||
if (err) throw err; | ||
|
||
// Declare the image | ||
map.addImage('pattern', image); | ||
|
||
// Use it | ||
map.addLayer({ | ||
"id": "pattern-layer", | ||
"type": "fill", | ||
"source": "source", | ||
"paint": { | ||
"fill-pattern": "pattern" | ||
} | ||
}); | ||
}); | ||
}); | ||
</script> |
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,10 @@ | ||
/*--- | ||
title: Add a pattern to a polygon | ||
description: Use [fill-pattern](https://docs.mapbox.com/mapbox-gl-js/style-spec/#paint-fill-fill-pattern) to draw a polygon from a repeating image pattern. | ||
tags: | ||
- layers | ||
pathname: /mapbox-gl-js/example/fill-pattern/ | ||
---*/ | ||
import Example from '../../components/example'; | ||
import html from './fill-pattern.html'; | ||
export default Example(html); |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.3.0/mapbox-gl-geocoder.min.js'></script> | ||
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.3.0/mapbox-gl-geocoder.css' type='text/css' /> | ||
<style> | ||
.geocoder-dropdown-item{ | ||
padding: 5px | ||
} | ||
.geocoder-dropdown-icon{ | ||
margin-right: 10px; | ||
} | ||
.geocoder-dropdown-text{ | ||
color: #5a3fc0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: larger; | ||
} | ||
</style> | ||
<div id='map'></div> | ||
|
||
<script> | ||
var map = new mapboxgl.Map({ | ||
container: 'map', | ||
style: 'mapbox://styles/mapbox/streets-v9', | ||
center: [-79.4512, 43.6568], | ||
zoom: 13 | ||
}); | ||
|
||
var geocoder = new MapboxGeocoder({ | ||
accessToken: mapboxgl.accessToken, | ||
types: 'poi', | ||
// see https://docs.mapbox.com/api/search/#geocoding-response-object for information about the schema of each response feature | ||
render: function(item) { | ||
// extract the item's maki icon or use a default | ||
var maki = item.properties.maki || 'marker'; | ||
return "<div class='geocoder-dropdown-item'><img class='geocoder-dropdown-icon' src='https://unpkg.com/@mapbox/[email protected]/icons/" + maki + "-15.svg'><span class='geocoder-dropdown-text'>" + item.text + "</span></div>"; | ||
}, | ||
mapboxgl: mapboxgl | ||
}); | ||
map.addControl(geocoder); | ||
|
||
</script> |
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,12 @@ | ||
/*--- | ||
title: Use a custom render function with a geocoder | ||
description: >- | ||
Use a custom html rendering function with the [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) | ||
to customize how the dropdown menu is displayed. | ||
tags: | ||
- geocoder | ||
pathname: /mapbox-gl-js/example/mapbox-gl-geocoder-custom-render/ | ||
---*/ | ||
import Example from '../../components/example'; | ||
import html from './mapbox-gl-geocoder-custom-render.html'; | ||
export default Example(html); |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.3.0/mapbox-gl-geocoder.min.js'></script> | ||
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.3.0/mapbox-gl-geocoder.css' type='text/css' /> | ||
<div id='map'></div> | ||
|
||
<script> | ||
var map = new mapboxgl.Map({ | ||
container: 'map', | ||
style: 'mapbox://styles/mapbox/streets-v9', | ||
center: [-79.4512, 43.6568], | ||
zoom: 13 | ||
}); | ||
|
||
var geocoder = new MapboxGeocoder({ | ||
accessToken: mapboxgl.accessToken, | ||
flyTo: { | ||
bearing: 0, | ||
// These options control the flight curve, making it move | ||
// slowly and zoom out almost completely before starting | ||
// to pan. | ||
speed: 0.2, // make the flying slow | ||
curve: 1, // change the speed at which it zooms out | ||
// This can be any easing function: it takes a number between | ||
// 0 and 1 and returns another number between 0 and 1. | ||
easing: function (t) { return t; } | ||
}, | ||
mapboxgl: mapboxgl | ||
}); | ||
map.addControl(geocoder); | ||
|
||
</script> |
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,12 @@ | ||
/*--- | ||
title: Use a custom camera animation with a geocoder | ||
description: >- | ||
Use camera animation options with the [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) | ||
to create a custom animation when a result is selected. | ||
tags: | ||
- geocoder | ||
pathname: /mapbox-gl-js/example/mapbox-gl-geocoder-with-flyto/ | ||
---*/ | ||
import Example from '../../components/example'; | ||
import html from './mapbox-gl-geocoder-with-flyto.html'; | ||
export default Example(html); |
Oops, something went wrong.