Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mb-pages'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Jan 19, 2016
2 parents 834ac80 + 09ddb94 commit 9eadd41
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/_posts/examples/3400-01-08-third-party.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: example
category: example
title: Add a third party vector tile source
description: Render a map using an external vector source of OpenStreetMap data provided by <a href='http://mapzen.com/vector/'>Mapzen</a>.
description: 'Render a map using an external vector source of OpenStreetMap data provided by <a target="_blank" href="http://mapzen.com/vector/">Mapzen</a>.'
---
<div id='map'></div>
<script>
Expand Down
2 changes: 1 addition & 1 deletion docs/_posts/examples/3400-01-11-mapbox-gl-directions.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: example
category: example
title: Display driving directions
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.
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.'
tags:
- plugins
- mapbox-directions
Expand Down
6 changes: 3 additions & 3 deletions docs/_posts/examples/3400-01-12-mapbox-gl-geocoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
layout: example
category: example
title: Add a geocoder
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.
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.'
tags:
- plugins
- mapbox-geocoding
---
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.js'></script>
<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' />
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
<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' />
<div id='map'></div>

<script>
Expand Down
69 changes: 69 additions & 0 deletions docs/_posts/examples/3400-01-16-point-from-geocoder-result.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: example
category: example
title: Set a point after Geocoder result
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.'
tags:
- plugins
- mapbox-geocoding
---
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
<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' />
<style>
#geocoder-container {
position: absolute;
top: 0;
width: 100%;
margin-top: 10px;
}

#geocoder-container > div {
min-width:50%;
margin-left:25%;
}
</style>
<div id='map'></div>
<div id='geocoder-container'></div>

<script>
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v8',
center: [-79.4512, 43.6568],
zoom: 13
});

var geocoder = new mapboxgl.Geocoder({
container: 'geocoder-container' // Optional. Specify a unique container for the control to be added to.
});

map.addControl(geocoder);

// After the map style has loaded on the page, add a source layer and default
// styling for a single point.
map.on('style.load', function() {
map.addSource('single-point', {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": []
}
});

map.addLayer({
"id": "point",
"source": "single-point",
"type": "circle",
"paint": {
"circle-radius": 10,
"circle-color": "#007cbf"
}
});

// Listen for the `geocoder.input` event that is triggered when a user
// makes a selection and add a marker that matches the result.
geocoder.on('geocoder.input', function(ev) {
map.getSource('single-point').setData(ev.result.geometry);
});
});
</script>
4 changes: 2 additions & 2 deletions docs/_posts/plugins/0100-01-01-mapbox-gl-geocoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
code: https://github.com/mapbox/mapbox-gl-geocoder
license: BSD
---
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.0.0/mapbox-gl-geocoder.js'></script>
<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' />
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v0.1.0/mapbox-gl-geocoder.js'></script>
<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' />
2 changes: 1 addition & 1 deletion js/ui/control/attribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = Attribution;
* @param {Object} [options]
* @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`
* @example
* var map = new mapboxgl.Map({attributionContro: false})
* var map = new mapboxgl.Map({attributionControl: false})
* .addControl(new mapboxgl.Navigation({position: 'top-left'}));
*/
function Attribution(options) {
Expand Down

0 comments on commit 9eadd41

Please sign in to comment.