From 56fd78cf65e06debcd504d4580351bcb14f3e9ee Mon Sep 17 00:00:00 2001 From: Victor Powell Date: Wed, 2 Dec 2015 01:16:59 -0800 Subject: [PATCH] Merge CHANGELOG into README. --- CHANGELOG.md | 92 ------------------------------------------------- README.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 92 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index c24ae072..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,92 +0,0 @@ -## 0.6 - -### Breaking changes - -#### No longer provide viewport props transparently to overlay children. - -Require viewport props to be explicitly provided to overlays. Previously, -viewport overlay props all had to be optional because the elements were created -once and then cloned inside of ``. This also made it difficult to follow -what props were being passed automatically to overlays. In addition, it meant -that overlays could only be direct children of the `` element. - -This shouldn't require changes to overlays, other than marking viewport props -as required. It will only involve passing the needed props explicitly to -overlays. - -Old way: - -```js - - - - -``` - -New way: - -```js - - - - -``` - -For any third party overlay's that depend on `project` or `unproject` props, -either update them to calculate the `project`/`unproject` functions from the -viewport using the [ViewportMercatorProject](github.com/uber-common/viewport-mercator-project) module or provide them explicitly in the same render function as the -`` component. example: - -```js -var ViewportMercator = require('viewport-mercator-project'); -// ... - render() { - var mercator = ViewportMercator(this.state.viewport); - return - - {/* or equivalently */} - - ; - } - -``` - -#### Swapping LatLng for LngLat - -This is more inline with -[MapboxGL-js](https://github.com/mapbox/mapbox-gl-js/pull/1433) and GeoJSON. - -Accessors that were previously `latLngAccessor` are have been renamed to -`lngLatAccessor`. - -Rename the viewport prop `startDragLatLng` to `startDragLngLat`. - -The `project` function prop passed to overlays now expecteds an array of -the form `[logitude, latitude]` instead of `[latitude, longitude]`. - -The `project` function prop now returns an array of `[pixelX, pixelY]` instead -of an object of the form `{x:pixelX, y: pixelY}`. - -The `unproject` function prop passed to overlays now returns an array of -the form `[longitude, latitude]` instead of a MapboxGL -[LngLat](https://www.mapbox.com/mapbox-gl-js/api/#LngLat) object. - -DraggablePointsOverlay's `locationAccessor` prop was renamed `lngLatAccessor` -to be more consistent with other overlays. - -#### `bbox` property of the `onChangeViewport` event was removed - -This should be calculated instead using the [ViewportMercatorProject](github.com/uber-common/viewport-mercator-project) module instead. - -```js -var mercator = ViewportMercator(viewport); -var bbox = [mercator.unproject([0, 0]), mercator.unproject([width, height])]; -``` - -### Non-breaking changes - -`unproject` was added to the arguments passed to the `redraw` callback in the -`CanvasOverlay`. \ No newline at end of file diff --git a/README.md b/README.md index 5589f842..ed834ed6 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,102 @@ Once complete, you can view the component in your browser at [localhost:9966](http://localhost:9966). Any changes you make will automatically run the compiler to build the files again. +# CHANGE LOG + +### 0.6 + +### Breaking changes + +#### No longer provide viewport props transparently to overlay children. + +Require viewport props to be explicitly provided to overlays. Previously, +viewport overlay props all had to be optional because the elements were created +once and then cloned inside of ``. This also made it difficult to follow +what props were being passed automatically to overlays. In addition, it meant +that overlays could only be direct children of the `` element. + +This shouldn't require changes to overlays, other than marking viewport props +as required. It will only involve passing the needed props explicitly to +overlays. + +Old way: + +```js + + + + +``` + +New way: + +```js + + + + +``` + +For any third party overlay's that depend on `project` or `unproject` props, +either update them to calculate the `project`/`unproject` functions from the +viewport using the [ViewportMercatorProject](github.com/uber-common/viewport-mercator-project) module or provide them explicitly in the same render function as the +`` component. example: + +```js +var ViewportMercator = require('viewport-mercator-project'); +// ... + render() { + var mercator = ViewportMercator(this.state.viewport); + return + + {/* or equivalently */} + + ; + } + +``` + +#### Swapping LatLng for LngLat + +This is more inline with +[MapboxGL-js](https://github.com/mapbox/mapbox-gl-js/pull/1433) and GeoJSON. + +Accessors that were previously `latLngAccessor` are have been renamed to +`lngLatAccessor`. + +Rename the viewport prop `startDragLatLng` to `startDragLngLat`. + +The `project` function prop passed to overlays now expecteds an array of +the form `[logitude, latitude]` instead of `[latitude, longitude]`. + +The `project` function prop now returns an array of `[pixelX, pixelY]` instead +of an object of the form `{x:pixelX, y: pixelY}`. + +The `unproject` function prop passed to overlays now returns an array of +the form `[longitude, latitude]` instead of a MapboxGL +[LngLat](https://www.mapbox.com/mapbox-gl-js/api/#LngLat) object. + +DraggablePointsOverlay's `locationAccessor` prop was renamed `lngLatAccessor` +to be more consistent with other overlays. + +#### `bbox` property of the `onChangeViewport` event was removed + +This should be calculated instead using the [ViewportMercatorProject](github.com/uber-common/viewport-mercator-project) module instead. + +```js +var mercator = ViewportMercator(viewport); +var bbox = [mercator.unproject([0, 0]), mercator.unproject([width, height])]; +``` + +### Non-breaking changes + +`unproject` was added to the arguments passed to the `redraw` callback in the +`CanvasOverlay`. + + ## Disclaimer This project is not affiliated with either Facebook or Mapbox.