Skip to content

Commit e4de0c7

Browse files
authored
Merge pull request fullstackreact#280 from andrewgouin/control_options
Control options
2 parents 01ecbce + 044b9d5 commit e4de0c7

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ return (
156156

157157
```
158158

159+
The following props are boolean values for map behavior:
160+
`scrollwheel`, `draggable`, `keyboardShortcuts`, `disableDoubleClickZoom`
161+
162+
The following props are boolean values for presence of controls on the map:
163+
`zoomControl`, `mapTypeControl`, `scaleControl`, `streetViewControl`, `panControl`, `rotateControl`, `fullscreenControl`
164+
165+
The following props are object values for control options such as placement of controls on the map:
166+
`zoomControlOptions`, `mapTypeControlOptions`, `streetViewControlOptions`
167+
See Google Maps [Controls](https://developers.google.com/maps/documentation/javascript/controls) for more information.
168+
169+
159170
It also takes event handlers described below:
160171

161172
### Events
@@ -218,6 +229,8 @@ render() {
218229
}
219230
```
220231

232+
The `<Map />` component also listens to `onRecenter`, `onBoundsChanged`, `onCenterChanged`, `onDblclick`, `onDragstart`, `onHeadingChange`, `onIdle`, `onMaptypeidChanged`, `onMousemove`, `onMouseout`, `onMouseover`, `onProjectionChanged`, `onResize`, `onRightclick`, `onTilesloaded`, `onTiltChanged`, and `onZoomChanged` events. See Google Maps [Events](https://developers.google.com/maps/documentation/javascript/events) for more information.
233+
221234
### Visibility
222235

223236
You can control the visibility of the map by using the `visible` prop. This is useful for situations when you want to use the Google Maps API without a map. The `<Map />` component will load like normal. See the [Google places demo](https://fullstackreact.github.io/google-maps-react/#/places)

dist/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,12 @@
250250
clickableIcons: !!this.props.clickableIcons,
251251
disableDefaultUI: this.props.disableDefaultUI,
252252
zoomControl: this.props.zoomControl,
253+
zoomControlOptions: this.props.zoomControlOptions,
253254
mapTypeControl: this.props.mapTypeControl,
255+
mapTypeControlOptions: this.props.mapTypeControlOptions,
254256
scaleControl: this.props.scaleControl,
255257
streetViewControl: this.props.streetViewControl,
258+
streetViewControlOptions: this.props.streetViewControlOptions,
256259
panControl: this.props.panControl,
257260
rotateControl: this.props.rotateControl,
258261
fullscreenControl: this.props.fullscreenControl,
@@ -392,9 +395,12 @@
392395
clickableIcons: _propTypes2.default.bool,
393396
disableDefaultUI: _propTypes2.default.bool,
394397
zoomControl: _propTypes2.default.bool,
398+
zoomControlOptions: _propTypes2.default.object,
395399
mapTypeControl: _propTypes2.default.bool,
400+
mapTypeControlOptions: _propTypes2.default.object,
396401
scaleControl: _propTypes2.default.bool,
397402
streetViewControl: _propTypes2.default.bool,
403+
streetViewControlOptions: _propTypes2.default.object,
398404
panControl: _propTypes2.default.bool,
399405
rotateControl: _propTypes2.default.bool,
400406
fullscreenControl: _propTypes2.default.bool,
@@ -427,4 +433,4 @@
427433
};
428434

429435
exports.default = Map;
430-
});
436+
});

dist/lib/String.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
value: true
1818
});
1919
var camelize = exports.camelize = function camelize(str) {
20-
return str.split('_').map(function (word) {
20+
return str.split(' ').map(function (word) {
2121
return word.charAt(0).toUpperCase() + word.slice(1);
2222
}).join('');
2323
};

src/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,12 @@ export class Map extends React.Component {
149149
clickableIcons: !!this.props.clickableIcons,
150150
disableDefaultUI: this.props.disableDefaultUI,
151151
zoomControl: this.props.zoomControl,
152+
zoomControlOptions: this.props.zoomControlOptions,
152153
mapTypeControl: this.props.mapTypeControl,
154+
mapTypeControlOptions: this.props.mapTypeControlOptions,
153155
scaleControl: this.props.scaleControl,
154156
streetViewControl: this.props.streetViewControl,
157+
streetViewControlOptions: this.props.streetViewControlOptions,
155158
panControl: this.props.panControl,
156159
rotateControl: this.props.rotateControl,
157160
fullscreenControl: this.props.fullscreenControl,
@@ -279,9 +282,12 @@ Map.propTypes = {
279282
clickableIcons: PropTypes.bool,
280283
disableDefaultUI: PropTypes.bool,
281284
zoomControl: PropTypes.bool,
285+
zoomControlOptions: PropTypes.object,
282286
mapTypeControl: PropTypes.bool,
287+
mapTypeControlOptions: PropTypes.bool,
283288
scaleControl: PropTypes.bool,
284289
streetViewControl: PropTypes.bool,
290+
streetViewControlOptions: PropTypes.object,
285291
panControl: PropTypes.bool,
286292
rotateControl: PropTypes.bool,
287293
fullscreenControl: PropTypes.bool,

src/lib/String.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const camelize = function(str) {
2-
return str.split('_').map(function(word) {
2+
return str.split(' ').map(function(word) {
33
return word.charAt(0).toUpperCase() + word.slice(1);
44
}).join('');
55
}

0 commit comments

Comments
 (0)