4.7.0 (2015-12-07)
4.6.2 (2015-12-07)
4.6.1 (2015-12-03)
4.6.0 (2015-11-22)
- GoogleMapLoader: introduce loader to manage React elements (532816a), closes #141 #133
- ScriptjsLoader: new behavior will render GoogleMapLoader instead (0f100d8)
- ScriptjsLoader: ScriptjsLoader will delegate to GoogleMapLoader when the script is loaded
Before:
<ScriptjsLoader
hostname={"maps.googleapis.com"}
pathname={"/maps/api/js"}
query={{v: `3.${ AsyncGettingStarted.version }`, libraries: "geometry,drawing,places"}}
loadingElement={
<div {...this.props} style={{ height: "100%" }}>
<FaSpinner />
</div>
}
googleMapElement={
<GoogleMap
containerProps={{
...this.props,
style: {
height: "100%",
},
}}
ref={googleMap => {
// Wait until GoogleMap is fully loaded. Related to #133
setTimeout(() => {
googleMap && console.log(`Zoom: ${ googleMap.getZoom() }`);
}, 50);
}}
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this.handleMapClick}
>
<Marker
{...this.state.marker}
onRightclick={this.handleMarkerRightclick}
/>
</GoogleMap>
}
/>
After:
<ScriptjsLoader
hostname={"maps.googleapis.com"}
pathname={"/maps/api/js"}
query={{v: `3.${ AsyncGettingStarted.version }`, libraries: "geometry,drawing,places"}}
loadingElement={
<div {...this.props} style={{ height: "100%" }}>
<FaSpinner />
</div>
}
containerElement={
<div {...this.props} style={{ height: "100%" }} />
}
googleMapElement={
<GoogleMap
ref={googleMap => {
googleMap && console.log(`Zoom: ${ googleMap.getZoom() }`);
}}
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this.handleMapClick}
>
<Marker
{...this.state.marker}
onRightclick={this.handleMarkerRightclick}
/>
</GoogleMap>
}
/>
- GoogleMapLoader: GoogleMap with props.containerProps is now deprecated. Use GoogleMapLoader with props.googleMapElement instead
We also suggest switching to callback based ref so that you'll get the component instance when it is mounted.
Before:
<GoogleMap containerProps={{
...this.props,
style: {
height: "100%",
},
}}
ref="map"
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this.handleMapClick}>
{this.state.markers.map((marker, index) => {
return (
<Marker
{...marker}
onRightclick={this.handleMarkerRightclick.bind(this, index)} />
);
})}
</GoogleMap>
After:
<GoogleMapLoader
containerElement={
<div
{...this.props}
style={{
height: "100%",
}}
/>
}
googleMapElement={
<GoogleMap
ref={(map) => console.log(map)}
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this.handleMapClick}>
{this.state.markers.map((marker, index) => {
return (
<Marker
{...marker}
onRightclick={this.handleMarkerRightclick.bind(this, index)} />
);
})}
</GoogleMap>
}
/>
4.5.1 (2015-11-21)
- ScriptjsLoader: check with propTypesElementOfType(GoogleMap) (e8bb97b)
4.5.0 (2015-11-21)
- async/ScriptjsLoader: migrate from async/ScriptjsGoogleMap to async/ScriptjsLoader and changed its behavior from implicit inheritance to simple delegation
To migrate the code follow the example below (extracted from examples/gh-pages migration):
Before:
<ScriptjsLoader
hostname={"maps.googleapis.com"}
pathname={"/maps/api/js"}
query={{v: `3.exp`, libraries: "geometry,drawing,places"}}
//
// <GoogleMap> props
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this._handle_map_click}
/>
After:
<ScriptjsLoader
hostname={"maps.googleapis.com"}
pathname={"/maps/api/js"}
query={{v: `3.exp`, libraries: "geometry,drawing,places"}}
//
googleMapElement={
<GoogleMap
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this._handle_map_click}
/>
}
/>
4.4.1 (2015-11-19)
4.4.0 (2015-11-19)
4.3.3 (2015-11-18)
4.3.2 (2015-11-17)
4.3.1 (2015-11-16)
- package.json: scriptjs should exist in dependencies (4f3304c)
4.3.0 (2015-11-16)
- ScriptjsGoogleMap: add "scriptjs" support (b80b731)
4.2.1 (2015-11-16)
- OverlayView: switch to ReactDOM (51fe680), closes #140
- OverlayView: use ReactDOM for unmountComponentAtNode (735eba0), closes #137
4.2.0 (2015-10-15)
4.1.1 (2015-10-14)
4.1.0 (2015-10-13)
- src: move instance creation in componentWillMount (91d5790)
- src: update composeOptions to accept controlledPropTypes for _2 (03aee4d)
4.0.0 (2015-10-08)
-
- React@^0.14: upgrade React in peerDependencies
- add react-dom@^0.14 to peerDependencies
- React@^0.14: upgrade React in peerDependencies
<a name"3.0.0">
<a name"2.2.0">
<a name"2.1.1">
<a name"2.1.0">
<a name"2.0.3">
- OverlayView:
- package.json: remove object-path (ee55b7a5)
<a name"2.0.2">
- GoogleMap: remove propTypes validation on children (0e417015)
- OverlayView: props.{default}mapPaneName should not be required (702a5710)
<a name"2.0.1">
<a name"2.0.0">
- InfoWindow: add ReactElement child as content support (2c0dc026, closes #69)
- Rectangle: add new componet (4511d87d, closes #80)
-
This commit rewrite this module from scratch.
-
GoogleMaps -> GoogleMap
- (Others Component names are the same)
-
OverlayView - Now only accepts single child
-
Remove asynchronous loading support
-
The props are not directly served as options for all google.maps instance.
- Instead, we convert setters to props and also expose getters on component instance.
-
To set an option directly, you can now pass options object just the same way as using Google Maps JavaScript APIs.
-
Expose props have two representation: controlled & uncontrolled
- uncontrolled props will have a
default${ PropName }
name - controlled props will be
${ propName }
as you expected
- uncontrolled props will have a
-
Uncontrolled props will be used only when the instance first mounted
-
Controlled props will call its corresponding setters every time rendered
MIGRATION GUIDE:
It introduces controlled property concept into the module. Most of the case, your application would like to have uncontrolled property. So change your component like this:
Before (v1.x.x):
<Marker
key={this.props.key}
position={this.props.position}
animation={this.props.animation}
onRightclick={this.handleMarkerRightclick} />
After (v2.x.x):
<Marker
key={this.props.key}
defaultPosition={this.props.position}
defaultAnimation={this.props.animation}
onRightclick={this.handleMarkerRightclick} />
The properties with default- prefix is uncontrolled property. It will only be set ONCE when the component is first-time mounted. Any further changes to your React props/state will NOT affect this marker (So it's uncontrolled from the view of React). Who can change the marker, you may ask. The answer is, only the component from google.maps.
But sometimes, we may want the marker's position changed according to current state. In that case, you have to provide controlled property to the <Marker [position={this.state.position}>
. By doing so, the marker's position will change every time the React props/state changes. However, it will not intercept the changes made by the component from google.maps. This is because for the <Marker>
itself, it doesn't know what events from google.maps will change its component. So the consumer who uses "react-google-maps" will have to manually handle this in their codebase.
(081d03f1)
<a name"1.7.1">
- src: eslint rules (012faada)
- VirtualContainer: propTypes.children should be renderable (a3d73af4)
- SimpleChildComponent: Make sure to only animate markers on the first run. (65aec078)
- src: eslint issues (adf3764b)
- InfoBox: Support for InfoBox (613e5ef5)
- DrawingManager: Support for Drawing API (9b3cbeba)
- SimpleChildComponent:
- GoogleMaps: constructor should use spread operator (d8e30af6)
- SimpleChildComponent: prevent removal of child during update (834d399b)
- VirtualContainer: preserve ref for React.cloneElement (3d3be964)
- GoogleMaps:
-
mapProps is no longer needed
since map children components are now rendered inside a virtual container, we don't need funky wrapper div anymore.
Before:
After:
(7e338c2a)
- package.json: add peerDependencies (15166996)
- src: rewrite with new API (a525d5f2)
- Map: expose fitBounds as public API (c64da722)
- Map: only pass id, className and style from props (284ab299)
- ChildMixin: remove invalid_context and duplicated contextTypes (80110a23)
- EventBindingMixin: pass instance when binding/unbinding (bb922794)
- GoogleMapsMixin: respond to update of googleMapsApi (3b0a0e07)
- InfoWindow:
- Map:
- Marker: event listeners (f878c002)
- Polygon: event listeners (5f98d0e1)
- create_child_component: event binding for child components (f4b1b022)
- expose_getters_from: should iterate all keys in prototype chain (5a89ed1c)
- ChildMixin:
- EventBindingMixin:
- GoogleMap:
- GoogleMapsMixin:
- InfoWindow: component with example (e227edf8)
- Map:
- Marker: update options when componentDidUpdate (0a7e490f)
- Polygon: add component and client example (556b9be9)
- Polyline: component with example (d0b802bb)
- index: create common child components by factory (43b791d2)