Skip to content

Commit

Permalink
feat(Map): expose panBy, panTo and panToBounds as public interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Nov 16, 2014
1 parent 5a89ed1 commit 6ccd128
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ MapSpec = {
_set_map: React.PropTypes.func
},

/*
* Some public API we'd like to expose
*/
panBy (x, y) {
ensure_map_created(this, (map) => {
map.panBy(x, y);
});
},

panTo (latLng) {
ensure_map_created(this, (map) => {
map.panTo(latLng);
});
},

panToBounds (latLngBounds) {
ensure_map_created(this, (map) => {
map.panToBounds(latLngBounds);
});
},

getInitialState () {
return {
/* [null, false, true] => ["init", "api loaded", "done"] */
Expand Down

0 comments on commit 6ccd128

Please sign in to comment.