react-google-maps
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -0,1 +1,9 @@ | ||
## 1.7.0 (2015-06-19) | ||
#### Features | ||
* **GoogleMaps:** specify map bounds via declarative props.bounds ([b1333c52](https://github.com/tomchentw/react-google-maps/commit/b1333c529fc4b338cef425dba9b4ba7d33937d29), closes [#64](https://github.com/tomchentw/react-google-maps/issues/64)) | ||
## 1.6.0 (2015-06-19) | ||
@@ -2,0 +10,0 @@ |
@@ -117,4 +117,5 @@ "use strict"; | ||
var googleMapsApi = props.googleMapsApi; | ||
var bounds = props.bounds; | ||
var googleMapsConfig = _objectWithoutProperties(props, ["containerProps", "googleMapsApi"]); | ||
var googleMapsConfig = _objectWithoutProperties(props, ["containerProps", "googleMapsApi", "bounds"]); | ||
@@ -124,2 +125,7 @@ /*eslint-enable no-unused-vars */ | ||
if (bounds) { | ||
delete googleMapsConfig.zoom; | ||
delete googleMapsConfig.center; | ||
} | ||
if (instance) { | ||
@@ -134,2 +140,7 @@ instance.setOptions(googleMapsConfig); | ||
} | ||
if (bounds) { | ||
instance.fitBounds(bounds); | ||
} | ||
return instance; | ||
@@ -173,3 +184,4 @@ } | ||
GoogleMaps.propTypes = _extends({}, _internalsEventComponent2["default"].propTypes, { | ||
containerProps: PropTypes.object.isRequired | ||
containerProps: PropTypes.object.isRequired, | ||
bounds: _react2["default"].PropTypes.object | ||
}); | ||
@@ -176,0 +188,0 @@ |
{ | ||
"__template__gist__": "https://gist.github.com/tomchentw/368a93bb748ad9d576f1#file-package-json", | ||
"name": "react-google-maps", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "React.js Google Maps integration component", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -58,6 +58,11 @@ import React from "react"; | ||
/*eslint-disable no-unused-vars */ | ||
const {containerProps, googleMapsApi, ...googleMapsConfig} = props; | ||
const {containerProps, googleMapsApi, bounds, ...googleMapsConfig} = props; | ||
/*eslint-enable no-unused-vars */ | ||
var {instance} = this.state; | ||
if (bounds) { | ||
delete googleMapsConfig.zoom; | ||
delete googleMapsConfig.center; | ||
} | ||
if (instance) { | ||
@@ -75,2 +80,7 @@ instance.setOptions(googleMapsConfig); | ||
} | ||
if (bounds) { | ||
instance.fitBounds(bounds); | ||
} | ||
return instance; | ||
@@ -110,2 +120,3 @@ } | ||
containerProps: PropTypes.object.isRequired, | ||
bounds: React.PropTypes.object | ||
}; | ||
@@ -112,0 +123,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88001
1545