Skip to content

Commit

Permalink
Revert API and examples updates for unreleased changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jan 16, 2015
1 parent bc3c357 commit 98c365f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 33 deletions.
22 changes: 9 additions & 13 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,21 @@ Method | Description
------ | ------
`addControl(control)` | Adds a control to the map

### Working with style classes
### Working with styles

Method | Description
------ | ------
`addClass(className)` | Adds a style class to the map
`removeClass(className)` | Removes a style class from the map
`hasClass(className)` | Returns boolean indicating whether a style class is active
`setClasses([className])` | Sets active style classes to a specified array
`getClasses()` | Returns an array of active style classes
`style.addClass(className)` | Adds a style class to the map
`style.removeClass(className)` | Removes a style class from the map
`style.hasClass(className)` | Returns boolean indicating whether a style class is active
`style.setClassList([className])` | Sets active style classes to a specified array
`style.getClassList()` | Returns an array of active style classes
`style.cascade()` | Applies map style, allowing for smooth transitions in modified paint properties

### Events

Event | Description
----- | -----
`render` | Fired whenever a frame is rendered to the WebGL context
`load` | Fired on the first complete render, when all dependencies have been loaded
`move` | Fired during any movement of the map (panning, zooming, rotation, etc.)
`movestart` | Fired on start of any movement of the map
`moveend` | Fired after movement of the map, when it becomes idle
Expand Down Expand Up @@ -237,17 +236,14 @@ Option | Description
`url` | A string or array of URL(s) to video files
`coordinates` | lat,lng coordinates in order clockwise starting at the top left: tl, tr, br, bl

## new mapboxgl.Navigation(options)
## new mapboxgl.Navigation()

Creates a navigation control with zoom buttons and a compass.

```js
map.addControl(new mapboxgl.Navigation({position: 'topleft'})); // position is optional
map.addControl(new mapboxgl.Navigation());
```

Option | Description
------ | ------
`position` | A string indicating the control's position on the map. Options are `topright`, `topleft`, `bottomright`, `bottomleft` (defaults to `topright`)

## mapboxgl.Evented

Expand Down
20 changes: 3 additions & 17 deletions docs/_posts/3400-01-01-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
subnav:
- title: mapboxgl.Navigation
url: /api
id: new-mapboxgl-navigation-options-
id: new-mapboxgl-navigation-
subnav:
- title: mapboxgl.Evented
url: /api
Expand Down Expand Up @@ -628,23 +628,9 @@ <h2 id="new-mapboxgl-videosource-options-">new mapboxgl.VideoSource(options)</h2
</tr>
</tbody>
</table>
<h2 id="new-mapboxgl-navigation-options-">new mapboxgl.Navigation(options)</h2><p>Creates a navigation control with zoom buttons and a compass.</p>
{% highlight js %}map.addControl(new mapboxgl.Navigation({position: 'topleft'})); // position is optional
<h2 id="new-mapboxgl-navigation-">new mapboxgl.Navigation()</h2><p>Creates a navigation control with zoom buttons and a compass.</p>
{% highlight js %}map.addControl(new mapboxgl.Navigation());
{% endhighlight %}
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>position</code></td>
<td>A string indicating the control&#39;s position on the map. Options are <code>topright</code>, <code>topleft</code>, <code>bottomright</code>, <code>bottomleft</code> (defaults to <code>topright</code>)</td>
</tr>
</tbody>
</table>
<h2 id="mapboxgl-evented">mapboxgl.Evented</h2><p>A class inherited by most other classes (<code>Map</code>, <code>Source</code> etc.) to get event capabilities.</p>
<h3 id="mapboxgl-evented-methods">Methods</h3><table>
<thead>
Expand Down
6 changes: 3 additions & 3 deletions docs/_posts/examples/3400-01-03-toggle-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
});

window.setInterval(function() {
if (map.hasClass('night')) {
map.removeClass('night');
if (map.style.classes.night) {
map.style.removeClass('night');
} else {
map.addClass('night');
map.style.addClass('night');
}
}, 2000);
});
Expand Down

0 comments on commit 98c365f

Please sign in to comment.