Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ScriptjsLoader): new behavior will render GoogleMapLoader instead
* Ref #92 BREAKING CHANGE: ScriptjsLoader will delegate to GoogleMapLoader when the script is loaded Before: ```js <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: ```js <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> } /> ```
- Loading branch information