Skip to content

Commit 9eadd41

Browse files
author
Lucas Wojciechowski
committed
Merge remote-tracking branch 'origin/mb-pages'
2 parents 834ac80 + 09ddb94 commit 9eadd41

File tree

6 files changed

+77
-8
lines changed

6 files changed

+77
-8
lines changed

docs/_posts/examples/3400-01-08-third-party.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: example
33
category: example
44
title: Add a third party vector tile source
5-
description: Render a map using an external vector source of OpenStreetMap data provided by <a href='http://mapzen.com/vector/'>Mapzen</a>.
5+
description: 'Render a map using an external vector source of OpenStreetMap data provided by <a target="_blank" href="http://mapzen.com/vector/">Mapzen</a>.'
66
---
77
<div id='map'></div>
88
<script>

docs/_posts/examples/3400-01-11-mapbox-gl-directions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: example
33
category: example
44
title: Display driving directions
5-
description: Use the <a target='_blank' href='https://github.com/mapbox/mapbox-gl-directions'>mapbox-gl-directions</a> plugin to show results from the Mapbox Directions API.
5+
description: 'Use the <a target="_blank" href="https://github.com/mapbox/mapbox-gl-directions">mapbox-gl-directions</a> plugin to show results from the Mapbox Directions API.'
66
tags:
77
- plugins
88
- mapbox-directions

docs/_posts/examples/3400-01-12-mapbox-gl-geocoder.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
layout: example
33
category: example
44
title: Add a geocoder
5-
description: Use the <a target='_blank' href='https://github.com/mapbox/mapbox-gl-geocoder'>mapbox-gl-geocoder</a> control to search for places using Mapbox Geocoding API.
5+
description: 'Use the <a target="_blank" href="https://github.com/mapbox/mapbox-gl-geocoder">mapbox-gl-geocoder</a> control to search for places using Mapbox Geocoding API.'
66
tags:
77
- plugins
88
- mapbox-geocoding
99
---
10-
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.js'></script>
11-
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.css' type='text/css' />
10+
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
11+
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.css' type='text/css' />
1212
<div id='map'></div>
1313

1414
<script>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
layout: example
3+
category: example
4+
title: Set a point after Geocoder result
5+
description: 'Listen to the <code>geocoder.input</code> event from the <a target="_blank" href="https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-geocoder">Geocoder plugin</a> and place a point on the coordinate results.'
6+
tags:
7+
- plugins
8+
- mapbox-geocoding
9+
---
10+
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
11+
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.css' type='text/css' />
12+
<style>
13+
#geocoder-container {
14+
position: absolute;
15+
top: 0;
16+
width: 100%;
17+
margin-top: 10px;
18+
}
19+
20+
#geocoder-container > div {
21+
min-width:50%;
22+
margin-left:25%;
23+
}
24+
</style>
25+
<div id='map'></div>
26+
<div id='geocoder-container'></div>
27+
28+
<script>
29+
var map = new mapboxgl.Map({
30+
container: 'map',
31+
style: 'mapbox://styles/mapbox/streets-v8',
32+
center: [-79.4512, 43.6568],
33+
zoom: 13
34+
});
35+
36+
var geocoder = new mapboxgl.Geocoder({
37+
container: 'geocoder-container' // Optional. Specify a unique container for the control to be added to.
38+
});
39+
40+
map.addControl(geocoder);
41+
42+
// After the map style has loaded on the page, add a source layer and default
43+
// styling for a single point.
44+
map.on('style.load', function() {
45+
map.addSource('single-point', {
46+
"type": "geojson",
47+
"data": {
48+
"type": "FeatureCollection",
49+
"features": []
50+
}
51+
});
52+
53+
map.addLayer({
54+
"id": "point",
55+
"source": "single-point",
56+
"type": "circle",
57+
"paint": {
58+
"circle-radius": 10,
59+
"circle-color": "#007cbf"
60+
}
61+
});
62+
63+
// Listen for the `geocoder.input` event that is triggered when a user
64+
// makes a selection and add a marker that matches the result.
65+
geocoder.on('geocoder.input', function(ev) {
66+
map.getSource('single-point').setData(ev.result.geometry);
67+
});
68+
});
69+
</script>

docs/_posts/plugins/0100-01-01-mapbox-gl-geocoder.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
code: https://github.com/mapbox/mapbox-gl-geocoder
1010
license: BSD
1111
---
12-
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.js'></script>
13-
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.css' type='text/css' />
12+
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
13+
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.css' type='text/css' />

js/ui/control/attribution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = Attribution;
1212
* @param {Object} [options]
1313
* @param {string} [options.position='bottom-right'] A string indicating the control's position on the map. Options are `top-right`, `top-left`, `bottom-right`, `bottom-left`
1414
* @example
15-
* var map = new mapboxgl.Map({attributionContro: false})
15+
* var map = new mapboxgl.Map({attributionControl: false})
1616
* .addControl(new mapboxgl.Navigation({position: 'top-left'}));
1717
*/
1818
function Attribution(options) {

0 commit comments

Comments
 (0)