summaryrefslogtreecommitdiff
path: root/platform/node
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-11-04 17:13:29 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-11-04 17:41:34 -0500
commit3528002b580f9e5ae19ef4df7543e913c5d27ab4 (patch)
tree878916b1f772e1fd07e2f0523732fdc506e01623 /platform/node
parentd00f8e37c78b47b014d1909fd35921d33903271f (diff)
downloadqtlocation-mapboxgl-3528002b580f9e5ae19ef4df7543e913c5d27ab4.tar.gz
[node] swap array order to [lng, lat] for render option center
For consistency with GeoJSON and mapbox-gl-js
Diffstat (limited to 'platform/node')
-rw-r--r--platform/node/CHANGELOG.md5
-rw-r--r--platform/node/README.md2
-rw-r--r--platform/node/src/node_map.cpp6
3 files changed, 7 insertions, 6 deletions
diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md
index d8f71fc292..70ad3486ee 100644
--- a/platform/node/CHANGELOG.md
+++ b/platform/node/CHANGELOG.md
@@ -4,6 +4,7 @@
# 2.0.0
- Integrates Node.js bindings into core mapbox-gl-native project. ([#2179](https://github.com/mapbox/mapbox-gl-native/pull/2179))
+- Adds Node.js v4.x and io.js v3.x support. ([#2261](https://github.com/mapbox/mapbox-gl-native/pull/2261))
- Requires an options object argument to `new mbgl.Map()`
(with required `request` and optional `cancel` methods),
drops `mbgl.FileSource`. ([mapbox/node-mapbox-gl-native#143](https://github.com/mapbox/node-mapbox-gl-native/pull/143))
@@ -12,14 +13,14 @@
- Requires numerical `ratio` in `mbgl.Map` options argument.
Map pixel ratio is now immutable and can no longer be set with
render options. ([`a8d9b92`](https://github.com/mapbox/mapbox-gl-native/commit/a8d9b921d71a91d7f8eff82e5a584aaab8b7d1c6), [#1799](https://github.com/mapbox/mapbox-gl-native/pull/1799))
+- Swaps array order in render options `center` argument to `[lng, lat]` for consistency with GeoJSON and mapbox-gl-js.
+- Adds render option `pitch` ([#2702](https://github.com/mapbox/mapbox-gl-native/pull/2702))
- `map.render` now returns a raw image buffer instead of an object with
`width`, `height` and `pixels` properties. ([#2262](https://github.com/mapbox/mapbox-gl-native/pull/2262))
- Adds support for rendering [mapbox-gl-style-spec](https://github.com/mapbox/mapbox-gl-style-spec) v8 styles.
- No longer loads resources before a render request is made. ([`55d25a8`](https://github.com/mapbox/mapbox-gl-native/commit/55d25a80a77c06ef5e66acc0d8518867b03fe8a4))
-- Adds Node.js v4.x and io.js v3.x support. ([#2261](https://github.com/mapbox/mapbox-gl-native/pull/2261))
- Fixes a bug which prevented raster tiles that `404`'ed from rendering ([#2458](https://github.com/mapbox/mapbox-gl-native/pull/2458))
- Fade transitions are now ignored to prevent half faded labels. ([#942](https://github.com/mapbox/mapbox-gl-native/pull/942))
-- Adds option `pitch` ([#2702](https://github.com/mapbox/mapbox-gl-native/pull/2702))
# 1.1.3
diff --git a/platform/node/README.md b/platform/node/README.md
index dfe5d909fe..36a5d5b36f 100644
--- a/platform/node/README.md
+++ b/platform/node/README.md
@@ -37,7 +37,7 @@ The first argument passed to `map.render` is an options object, all keys are opt
zoom: {zoom}, // number, defaults to 0
width: {width}, // number (px), defaults to 512
height: {height}, // number (px), defaults to 512
- center: [{latitude}, {longitude}], // array of numbers (coordinates), defaults to [0,0]
+ center: [{longitude}, {latitude}], // array of numbers (coordinates), defaults to [0,0]
bearing: {bearing}, // number (in degrees, counter-clockwise from north), defaults to 0
classes: {classes} // array of strings
}
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index c47eae3614..8b2b5fc53d 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -211,8 +211,8 @@ std::unique_ptr<NodeMap::RenderOptions> NodeMap::ParseOptions(v8::Local<v8::Obje
if (Nan::Has(obj, Nan::New("center").ToLocalChecked()).FromJust()) {
auto center = Nan::Get(obj, Nan::New("center").ToLocalChecked()).ToLocalChecked().As<v8::Array>();
- if (center->Length() > 0) { options->latitude = Nan::Get(center, 0).ToLocalChecked()->NumberValue(); }
- if (center->Length() > 1) { options->longitude = Nan::Get(center, 1).ToLocalChecked()->NumberValue(); }
+ if (center->Length() > 0) { options->longitude = Nan::Get(center, 0).ToLocalChecked()->NumberValue(); }
+ if (center->Length() > 1) { options->latitude = Nan::Get(center, 1).ToLocalChecked()->NumberValue(); }
}
if (Nan::Has(obj, Nan::New("width").ToLocalChecked()).FromJust()) {
@@ -243,7 +243,7 @@ std::unique_ptr<NodeMap::RenderOptions> NodeMap::ParseOptions(v8::Local<v8::Obje
* @param {number} [options.zoom=0]
* @param {number} [options.width=512]
* @param {number} [options.height=512]
- * @param {Array<number>} [options.center=[0,0]] latitude, longitude center
+ * @param {Array<number>} [options.center=[0,0]] longitude, latitude center
* of the map
* @param {number} [options.bearing=0] rotation
* @param {Array<string>} [options.classes=[]] GL Style Classes