diff --git a/examples/gh-pages/scripts/components/AsyncGettingStarted.js b/examples/gh-pages/scripts/components/AsyncGettingStarted.js index d79ef39a..37559691 100644 --- a/examples/gh-pages/scripts/components/AsyncGettingStarted.js +++ b/examples/gh-pages/scripts/components/AsyncGettingStarted.js @@ -30,7 +30,7 @@ export default class AsyncGettingStarted extends Component { * This is called when you click on the map. * Go and try click now. */ - _handle_map_click (event) { + handleMapClick (event) { var {markers} = this.state; markers = update(markers, { $push: [ @@ -51,7 +51,7 @@ export default class AsyncGettingStarted extends Component { } } - _handle_marker_rightclick (index, event) { + handleMarkerRightclick (index, event) { /* * All you modify is data, and the view is driven by data. * This is so called data-driven-development. (And yes, it's now in @@ -99,12 +99,12 @@ export default class AsyncGettingStarted extends Component { ref="map" defaultZoom={3} defaultCenter={{lat: -25.363882, lng: 131.044922}} - onClick={::this._handle_map_click}> + onClick={::this.handleMapClick}> {this.state.markers.map((marker, index) => { return ( + onRightclick={this.handleMarkerRightclick.bind(this, index)} /> ); })} diff --git a/examples/gh-pages/scripts/components/GeojsonToComponents.js b/examples/gh-pages/scripts/components/GeojsonToComponents.js index 34fe567e..32ab78ab 100644 --- a/examples/gh-pages/scripts/components/GeojsonToComponents.js +++ b/examples/gh-pages/scripts/components/GeojsonToComponents.js @@ -44,30 +44,30 @@ export default class GeojsonToComponents extends Component { 0: { ref: "map", style: {height: "100%"}, - onClick: ::this._handle_map_click, - onZoomChanged: ::this._handle_map_zoom_changed, + onClick: ::this.handleMapClick, + onZoomChanged: ::this.handleMapZoomChanged, }, 1: { ref: "centerMarker", visible: true, draggable: true, - onDragend: ::this._handle_marker_dragend, - onClick: ::this._handle_marker_click, + onDragend: ::this.handleMarkerDragend, + onClick: ::this.handleMarkerClick, child: { content: "Bermuda Triangle", owner: "centerMarker", }, }, 3: { - onRightclick: ::this._handle_polygon_rightclick, + onRightclick: ::this.handlePolygonRightclick, }, }, } - _handle_map_click () { + handleMapClick () { } - _handle_map_zoom_changed () { + handleMapZoomChanged () { this.setState(update(this.state, { geoStateBy: { 0: { @@ -84,7 +84,7 @@ export default class GeojsonToComponents extends Component { })); } - _handle_marker_click () { + handleMarkerClick () { this.setState(update(this.state, { geoStateBy: { 0: { @@ -96,7 +96,7 @@ export default class GeojsonToComponents extends Component { })); } - _handle_polygon_rightclick () { + handlePolygonRightclick () { this.setState(update(this.state, { geoStateBy: { 1: { @@ -108,7 +108,7 @@ export default class GeojsonToComponents extends Component { })); } - _handle_marker_dragend ({latLng}) { + handleMarkerDragend ({latLng}) { const marker = this.state.geoJson.features[1], originalCoordinates = marker.properties.originalCoordinates || marker.geometry.coordinates, newCoordinates = [latLng.lng(), latLng.lat()]; diff --git a/examples/gh-pages/scripts/components/GettingStarted.js b/examples/gh-pages/scripts/components/GettingStarted.js index 2751a55f..5f27876c 100644 --- a/examples/gh-pages/scripts/components/GettingStarted.js +++ b/examples/gh-pages/scripts/components/GettingStarted.js @@ -26,7 +26,7 @@ export default class GettingStarted extends Component { * This is called when you click on the map. * Go and try click now. */ - _handle_map_click (event) { + handleMapClick (event) { var {markers} = this.state; markers = update(markers, { $push: [ @@ -47,7 +47,7 @@ export default class GettingStarted extends Component { } } - _handle_marker_rightclick (index, event) { + handleMarkerRightclick (index, event) { /* * All you modify is data, and the view is driven by data. * This is so called data-driven-development. (And yes, it's now in @@ -73,12 +73,12 @@ export default class GettingStarted extends Component { ref="map" defaultZoom={3} defaultCenter={{lat: -25.363882, lng: 131.044922}} - onClick={::this._handle_map_click}> + onClick={::this.handleMapClick}> {this.state.markers.map((marker, index) => { return ( + onRightclick={this.handleMarkerRightclick.bind(this, index)} /> ); })} diff --git a/examples/gh-pages/scripts/components/events/AccessingArguments.js b/examples/gh-pages/scripts/components/events/AccessingArguments.js index e581827b..c1a01b49 100644 --- a/examples/gh-pages/scripts/components/events/AccessingArguments.js +++ b/examples/gh-pages/scripts/components/events/AccessingArguments.js @@ -14,7 +14,7 @@ export default class AccessingArguments extends Component { center: new google.maps.LatLng(-25.363882, 131.044922), } - _handle_map_click (event) { + handleMapClick (event) { const {markers} = this.state; markers.push({ position: event.latLng @@ -38,7 +38,7 @@ export default class AccessingArguments extends Component { ref="map" defaultZoom={4} center={center} - onClick={::this._handle_map_click}> + onClick={::this.handleMapClick}> {markers.map((marker, index) => )} diff --git a/examples/gh-pages/scripts/components/events/ClosureListeners.js b/examples/gh-pages/scripts/components/events/ClosureListeners.js index 98450a3e..28d50682 100644 --- a/examples/gh-pages/scripts/components/events/ClosureListeners.js +++ b/examples/gh-pages/scripts/components/events/ClosureListeners.js @@ -38,30 +38,30 @@ export default class ClosureListeners extends Component { }); } - _handle_marker_click (marker) { + handleMarkerClick (marker) { marker.showInfo = true; this.setState(this.state); } - _handle_closeclick (marker) { + handleCloseclick (marker) { marker.showInfo = false; this.setState(this.state); } - _render_InfoWindow (ref, marker) { + renderInfoWindow (ref, marker) { if (Math.random() > 0.5) { // Normal version: Pass string as content return ( ) } else { // "react-google-maps" extended version: Pass ReactElement as content return (
{marker.content} @@ -92,8 +92,8 @@ export default class ClosureListeners extends Component { - {marker.showInfo ? this._render_InfoWindow(ref, marker) : null} + onClick={this.handleMarkerClick.bind(this, marker)}> + {marker.showInfo ? this.renderInfoWindow(ref, marker) : null} ); })} diff --git a/examples/gh-pages/scripts/components/events/GettingProperties.js b/examples/gh-pages/scripts/components/events/GettingProperties.js index 0276ca07..db17006a 100644 --- a/examples/gh-pages/scripts/components/events/GettingProperties.js +++ b/examples/gh-pages/scripts/components/events/GettingProperties.js @@ -14,7 +14,7 @@ export default class GettingProperties extends Component { content: "Change the zoom level", } - _handle_zoom_changed () { + handleZoomChanged () { const zoomLevel = this.refs.map.getZoom(); if (zoomLevel !== this.state.zoomLevel) { // Notice: Check zoomLevel equality here, @@ -40,7 +40,7 @@ export default class GettingProperties extends Component { ref="map" defaultCenter={myLatLng} zoom={zoomLevel} - onZoomChanged={::this._handle_zoom_changed}> + onZoomChanged={::this.handleZoomChanged}> + onCenterChanged={::this.handleMapCenterChanged}> + onClick={::this.handleMarkerClick} /> ); } diff --git a/examples/gh-pages/scripts/components/places/SearchBox.js b/examples/gh-pages/scripts/components/places/SearchBox.js index 4622af0d..68eed9a2 100644 --- a/examples/gh-pages/scripts/components/places/SearchBox.js +++ b/examples/gh-pages/scripts/components/places/SearchBox.js @@ -35,14 +35,14 @@ export default class SearchBoxExample extends Component { markers: [] } - _handle_bounds_changed () { + handleBoundsChanged () { this.setState({ bounds: this.refs.map.getBounds(), center: this.refs.map.getCenter() }); } - _handle_places_changed () { + handlePlacesChanged () { const places = this.refs.searchBox.getPlaces(); const markers = []; @@ -76,13 +76,13 @@ export default class SearchBoxExample extends Component { } }} defaultZoom={15} - onBoundsChanged={::this._handle_bounds_changed} + onBoundsChanged={::this.handleBoundsChanged} ref="map">