react-google-maps
Advanced tools
Comparing version 4.6.2 to 4.7.0
@@ -0,1 +1,11 @@ | ||
<a name="4.7.0"></a> | ||
# [4.7.0](https://github.com/tomchentw/react-google-maps/compare/v4.6.2...v4.7.0) (2015-12-07) | ||
### Features | ||
* **utils:** add triggerEvent api ([112a1e6](https://github.com/tomchentw/react-google-maps/commit/112a1e6)), closes [#161](https://github.com/tomchentw/react-google-maps/issues/161) | ||
<a name="4.6.2"></a> | ||
@@ -2,0 +12,0 @@ ## [4.6.2](https://github.com/tomchentw/react-google-maps/compare/v4.6.1...v4.6.2) (2015-12-07) |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.removeListener = removeListener; | ||
exports.trigger = trigger; | ||
@@ -18,2 +19,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function removeListener(id) {} | ||
function removeListener(id) {} | ||
function trigger(instance) {} |
@@ -13,2 +13,3 @@ "use strict"; | ||
it("should be exported", function () { | ||
(0, _expect2["default"])(_index.GoogleMapLoader).toExist(); | ||
(0, _expect2["default"])(_index.GoogleMap).toExist(); | ||
@@ -15,0 +16,0 @@ |
@@ -168,2 +168,3 @@ "use strict"; | ||
return _react2["default"].createElement(_GoogleMapLoader2["default"], { | ||
ref: "loader", | ||
containerElement: _react2["default"].createElement(realContainerTagName, containerProps), | ||
@@ -170,0 +171,0 @@ googleMapElement: _react2["default"].createElement( |
{ | ||
"__template__gist__": "https://gist.github.com/tomchentw/368a93bb748ad9d576f1#file-package-json", | ||
"name": "react-google-maps", | ||
"version": "4.6.2", | ||
"version": "4.7.0", | ||
"description": "React.js Google Maps integration component", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
"config": { | ||
"mocha": "--compilers js:babel/register ./src/**/__tests__/*.spec.js --require ./src/__tests__/__setup__.js" | ||
"mocha": "--compilers js:babel/register ./src/__tests__/*.spec.js ./src/**/__tests__/*.spec.js --require ./src/__tests__/__setup__.js" | ||
}, | ||
@@ -28,0 +28,0 @@ "repository": { |
@@ -1,5 +0,5 @@ | ||
# react-google-maps [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-image]][codeclimate-url] [![Coverage][codeclimate-coverage-image]][codeclimate-coverage-url] [![Dependencies][gemnasium-image]][gemnasium-url] [![Gitter][gitter-image]][gitter-url] | ||
# react-google-maps | ||
> React.js Google Maps integration component | ||
[![Version][npm-image]][npm-url] | ||
[![Version][npm-image]][npm-url] [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-image]][codeclimate-url] [![Coverage][codeclimate-coverage-image]][codeclimate-coverage-url] [![Dependencies][gemnasium-image]][gemnasium-url] [![Gitter][gitter-image]][gitter-url] | ||
@@ -77,15 +77,2 @@ | ||
### Map Event Triggers | ||
One common event trigger is to resize map after the size of the container div changes: | ||
```js | ||
componentDidUpdate() { | ||
var map = ReactDOM.findDOMNode(this.refs.map); | ||
window.google.maps.event.trigger(map, 'resize'); | ||
} | ||
<GoogleMap {...props} ref="map" > ... </GoogleMap> | ||
``` | ||
### Check the examples | ||
@@ -110,2 +97,16 @@ | ||
### Trigger events | ||
`triggerEvent(component, ...args)`: One common event trigger is to resize map after the size of the container div change. | ||
```js | ||
import {triggerEvent} from "react-google-maps/lib/utils"; | ||
function handleWindowResize () { | ||
triggerEvent(this._googleMapComponent, "resize"); | ||
} | ||
// and you'll get `this._googleMapComponent` like this: | ||
<GoogleMap ref={it => this._googleMapComponent = it} /> | ||
``` | ||
### Optimize bundle size | ||
@@ -112,0 +113,0 @@ |
@@ -9,2 +9,5 @@ import { | ||
export function removeListener (id) { | ||
} | ||
} | ||
export function trigger (instance, ...args) { | ||
} |
@@ -6,2 +6,3 @@ import { | ||
import { | ||
GoogleMapLoader, | ||
GoogleMap, | ||
@@ -23,2 +24,3 @@ | ||
it("should be exported", () => { | ||
expect(GoogleMapLoader).toExist(); | ||
expect(GoogleMap).toExist(); | ||
@@ -25,0 +27,0 @@ |
@@ -105,2 +105,3 @@ import { | ||
<GoogleMapLoader | ||
ref="loader" | ||
containerElement={React.createElement(realContainerTagName, containerProps)} | ||
@@ -107,0 +108,0 @@ googleMapElement={ |
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
353736
122
6757
213