Commit Graph

130 Commits

Author SHA1 Message Date
Konstantin Käfer
27f9a85fea [node] don't fire callback for canceled AsyncRequest 2016-05-26 20:17:36 +02:00
John Firebaugh
8ec0b70722 [core] Use mapbox::geometry::box in queryRenderedFeatures 2016-05-13 09:01:32 -07:00
John Firebaugh
c8391729c7 [core] Use geometry.hpp feature type 2016-05-03 17:25:49 -07:00
Ansis Brammanis
61d14089e0 [core] implement queryRenderedFeatures 2016-04-29 12:00:24 -07:00
John Firebaugh
204c7fee03 [core] Render from the main thread
Do not create a thread for the MapContext anymore.
2016-04-14 13:44:08 -07:00
John Firebaugh
169755e89a [core] Unify FileRequest and WorkRequest 2016-03-24 10:54:32 -07:00
Thiago Marcos P. Santos
63982e0010 Revert "[node] Destroy the RunLoop with the last Map object"
This reverts commit 3633fd7ebd.
2016-02-24 14:31:11 +02:00
Thiago Marcos P. Santos
3633fd7ebd [node] Destroy the RunLoop with the last Map object
The last map object to get destroyed will also destroy
the RunLoop (which will also destroy the AsyncTask).

This will clear any reference to the Node default main
loop and let it close.

Downside is that we need to make sure we are always calling
`map.release()`.
2016-02-20 13:33:13 +02:00
Ansis Brammanis
29d61c0fe7 [node] add debug options to node bindings
fix #3579
2016-02-08 14:22:53 -08:00
Mike Morris
86691a08de [node] patch memory leak in NodeMap::request
Creating a v8::Function with
Nan::GetFunction(Nan::New<v8::FunctionTemplate>) can leak, use
Nan::New<v8::Function> instead.

https://code.google.com/p/chromium/issues/detail?id=272579
2016-02-04 18:27:52 -05:00
Mike Morris
f4d394d935 [node] code review cleanup 2015-12-15 10:19:56 -08:00
John Firebaugh
896245e510 [test] Update test suite 2015-12-09 16:25:45 -08:00
Thiago Marcos P. Santos
873eabcf28 [node] Fix build on GCC 4.9.2 2015-11-26 19:40:36 +02:00
John Firebaugh
1d33790dc0 [core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
2015-11-25 15:57:37 -08:00
John Firebaugh
0c1e378bc9 [core] Rewrite image handling
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
John Firebaugh
36081f6486 [core] For binary image data use uint8_t, not char 2015-11-23 17:28:44 -08:00
John Firebaugh
c4c3a19d85 [node] Allow GC in spite of reference loops through the request method
The following produces a reference cycle:

var map = new mbgl.Map({
    request: function () { ... }
});

map has a reference to the request function, which has a reference to
its closure, which has a reference to map.

Storing a the map options in an internal field, rather than a Persistent,
allows V8 to collect the reference cycle when none of its members have
other references.
2015-11-20 16:33:46 -08:00
Mike Morris
5e58070dec [node] make ratio optional, default to 1.0 2015-11-04 18:18:08 -05:00
Mike Morris
3528002b58 [node] swap array order to [lng, lat] for render option center
For consistency with GeoJSON and mapbox-gl-js
2015-11-04 17:41:34 -05:00
bsudekum
93c5bc08b3 [node] add pitch option 2015-11-02 16:58:24 -08:00
Tom MacWright
26cb45ed46 Document node-mapbox-gl-native with JSDoc 2015-10-29 16:55:30 -07:00
John Firebaugh
014b517820 [node] Output debug logs when a render test times out 2015-10-28 15:54:34 -07:00
Mike Morris
62595a9b39 [core] bump libuv to 1.7.5 across all platforms
UV_ASYNC_PARAMS and UV_TIMER_PARAMS for libuv <= 0.10 compatibility

use st_mtim.tv_sec in libuv > 0.10.x
2015-10-14 11:36:28 -04:00
Mike Morris
a101ab4cf5 [node] throw if a render is already pending, fixes #2247 2015-09-15 13:29:46 -04:00
John Firebaugh
532bbd5484 Add anonymous lambda for HandleScope 2015-09-09 15:06:54 -07:00
Mike Morris
627623edbc Use nan with https://github.com/nodejs/nan/pull/443 fixed 2015-09-09 14:57:15 -07:00
John Firebaugh
0531b38367 Nan 2.0 2015-09-09 14:55:14 -07:00
bsudekum
3db1421eb1 Return raw image buffer instead of an object 2015-09-04 12:01:34 -07:00
Mike Morris
853da02101 drop ratio from RenderOptions 2015-09-01 17:18:12 -04:00
Mike Morris
6e6387e089 move node-mbgl to platform/node/ directory 2015-08-21 16:22:04 -04:00