From 98c365f300857c4fd1dc413e8ed8376c76008a21 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 16 Jan 2015 13:54:02 -0800 Subject: [PATCH] Revert API and examples updates for unreleased changes --- API.md | 22 ++++++++----------- docs/_posts/3400-01-01-api.html | 20 +++-------------- .../examples/3400-01-03-toggle-styles.html | 6 ++--- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/API.md b/API.md index d098b1171f3..b8cc4696d3c 100644 --- a/API.md +++ b/API.md @@ -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 @@ -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 diff --git a/docs/_posts/3400-01-01-api.html b/docs/_posts/3400-01-01-api.html index a4803aa0c0c..48ffaf35cbb 100644 --- a/docs/_posts/3400-01-01-api.html +++ b/docs/_posts/3400-01-01-api.html @@ -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 @@ -628,23 +628,9 @@

new mapboxgl.VideoSource(options)

-

new mapboxgl.Navigation(options)

Creates a navigation control with zoom buttons and a compass.

-{% highlight js %}map.addControl(new mapboxgl.Navigation({position: 'topleft'})); // position is optional +

new mapboxgl.Navigation()

Creates a navigation control with zoom buttons and a compass.

+{% highlight js %}map.addControl(new mapboxgl.Navigation()); {% endhighlight %} - - - - - - - - - - - - - -
OptionDescription
positionA string indicating the control's position on the map. Options are topright, topleft, bottomright, bottomleft (defaults to topright)

mapboxgl.Evented

A class inherited by most other classes (Map, Source etc.) to get event capabilities.

Methods

diff --git a/docs/_posts/examples/3400-01-03-toggle-styles.html b/docs/_posts/examples/3400-01-03-toggle-styles.html index 9cf03c94acd..755596f3fc2 100644 --- a/docs/_posts/examples/3400-01-03-toggle-styles.html +++ b/docs/_posts/examples/3400-01-03-toggle-styles.html @@ -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); });