Skip to content

Commit 52286b8

Browse files
committed
Fix readme headings
1 parent 64d9db5 commit 52286b8

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

README.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
[![npm version](https://badge.fury.io/js/google-map-react.svg)](http://badge.fury.io/js/google-map-react)
22
[![Build Status](https://travis-ci.org/istarkov/google-map-react.svg?branch=master)](https://travis-ci.org/istarkov/google-map-react)
33

4-
`google-map-react` is a component written over a small set of the [Google Maps API](https://developers.google.com/maps/). It allows you to render any React component on the Google Map. It is fully isomorphic and can render on a server. Additionally, it can render map components in the browser even if the Google Maps API is not loaded. It uses an internal, tweakable hover algorithm - every object on the map can be hovered.
4+
`google-map-react` is a component written over a small set of the [Google Maps API](https://developers.google.com/maps/). It allows you to render any React component on the Google Map. It is fully isomorphic and can render on a server. Additionally, it can render map components in the browser even if the Google Maps API is not loaded. It uses an internal, tweakable hover algorithm - every object on the map can be hovered.
55

66
It allows you to create interfaces like this [example](http://istarkov.github.io/google-map-react/map/main) *(You can scroll the table, zoom/move the map, hover/click on markers, and click on table rows)*
77

88

9-
##Features
9+
## Features
1010

11-
###Works with your Components
11+
### Works with your Components
1212

1313
Instead of the ugly Google Maps markers, balloons and other map components, you can render your cool animated react components on the map.
1414

15-
###Isomorphic Rendering
15+
### Isomorphic Rendering
1616

1717
It renders on the server. *(Welcome search engines)* *(you can disable javascript in browser dev tools, and reload any example page to see how it works)*
1818

19-
###Component Positions Calculated Independently of Google Maps API
19+
### Component Positions Calculated Independently of Google Maps API
2020

2121
It renders components on the map before (and even without) the Google Maps API loaded.
2222

23-
###Google Maps API Loads on Demand
23+
### Google Maps API Loads on Demand
2424

2525
There is no need to place a `<script src=` tag at top of page. The Google Maps API loads upon the first usage of the `GoogleMap` component.
2626

27-
###Internal Hover Algorithm
27+
### Internal Hover Algorithm
2828

2929
Now every object on the map can be hovered (however, you can still use css hover selectors if you want). If you try zooming out here [example](http://istarkov.github.io/google-map-react/map/main), you will still be able to hover on almost every map marker.
3030

3131
This algorithm allows you to tweak hover probability of map objects, for example making some objects "more hoverable". [distance_hover example with different hover probabilities](http://istarkov.github.io/google-map-react/map/distance_hover)
3232

33-
##Known Issues
33+
## Known Issues
3434

3535
* Small icons jiggle on Firefox (I don't see this in my older 'GoogleMap' version, so I will find the problem soon)
3636

3737

38-
##Installation
38+
## Installation
3939

4040
### npm
4141

@@ -48,12 +48,12 @@ npm install --save google-map-react
4848
We no longer intend to support Bower. Please stop using Bower. NPM works very well for front-end development, and you should use it instead. ((c)Dan Abramov)
4949
UMD AMD and other build are available under dist folder after `npm install`
5050

51-
##What's it Look Like?
51+
## What's it Look Like?
5252

5353
In the simple case you just need to add `lat` `lng` props to any child of `GoogleMap` component.
5454
[simple example in action](http://istarkov.github.io/google-map-react/map/simple)
5555

56-
```jsx
56+
```javascript
5757
import React, {PropTypes, Component} from 'react/addons';
5858
import shouldPureComponentUpdate from 'react-pure-render/function';
5959

@@ -68,7 +68,7 @@ export default class SimpleMapPage extends Component {
6868
};
6969

7070
shouldComponentUpdate = shouldPureComponentUpdate;
71-
71+
7272
constructor(props) {
7373
super(props);
7474
}
@@ -86,7 +86,7 @@ export default class SimpleMapPage extends Component {
8686
}
8787
```
8888

89-
##Examples
89+
## Examples
9090

9191
* Placing react components on the map:
9292
[simple](http://istarkov.github.io/google-map-react/map/simple/) ([source](https://github.com/istarkov/google-map-react-examples/blob/master/web/flux/components/examples/x_simple/simple_map_page.jsx))
@@ -95,7 +95,7 @@ export default class SimpleMapPage extends Component {
9595
[example](http://istarkov.github.io/google-map-react/map/options/) ([source](https://github.com/istarkov/google-map-react-examples/blob/master/web/flux/components/examples/x_options/options_map_page.jsx))
9696

9797
* Hover effects:
98-
[simple hover](http://istarkov.github.io/google-map-react/map/simple_hover/) ([source](https://github.com/istarkov/google-map-react-examples/blob/master/web/flux/components/examples/x_simple_hover/simple_hover_map_page.jsx));
98+
[simple hover](http://istarkov.github.io/google-map-react/map/simple_hover/) ([source](https://github.com/istarkov/google-map-react-examples/blob/master/web/flux/components/examples/x_simple_hover/simple_hover_map_page.jsx));
9999
[distance hover](http://istarkov.github.io/google-map-react/map/distance_hover/) ([source](https://github.com/istarkov/google-map-react-examples/blob/master/web/flux/components/examples/x_distance_hover/distance_hover_map_page.jsx))
100100

101101
* GoogleMap events:
@@ -111,16 +111,16 @@ export default class SimpleMapPage extends Component {
111111

112112
### parameters
113113

114-
####apiKey (string) (_Deprecated use bootstrapURLKeys_)
114+
#### apiKey (string) (_Deprecated use bootstrapURLKeys_)
115115

116116
Google maps api key. (Optional, but your map will be rate-limited with no key)
117117

118-
####bootstrapURLKeys (object)
118+
#### bootstrapURLKeys (object)
119119

120-
Example:
120+
Example:
121121

122122
```javascript
123-
<GoogleMap
123+
<GoogleMap
124124
bootstrapURLKeys={{
125125
key: API_KEY,
126126
language: 'ru',
@@ -129,45 +129,45 @@ Example:
129129
>
130130
```
131131

132-
####defaultCenter (array or object)
132+
#### defaultCenter (array or object)
133133

134134
`[lat, lng]` or `{ lat: lat, lng: lng}`
135135
Default lat/lng at which to center the map - changing this prop throws a warning
136136

137-
####center (array or object)
137+
#### center (array or object)
138138

139139
`[lat, lng]` or `{ lat: lat, lng: lng}`
140140
Lat/lng at which to center the map
141141

142-
####defaultZoom: (number)
142+
#### defaultZoom: (number)
143143

144144
Default map zoom level - changing this prop throws a warning
145145

146-
####zoom (number)
146+
#### zoom (number)
147147

148148
Map zoom level
149149

150-
####hoverDistance (number)
150+
#### hoverDistance (number)
151151

152152
Default: 30
153153

154-
####margin (array)
154+
#### margin (array)
155155

156156
In onChange callback, gives you a marginBounds argument property, where lat lng will be shifted using margin you have set. For example, you could use a simple check pointInRect to not show Markers near map bounds.
157157

158-
####debounced (bool)
158+
#### debounced (bool)
159159

160160
Default: true
161161

162162
### callbacks
163163

164-
####options (func|object)
164+
#### options (func|object)
165165

166166
Set map options such as controls positions / styles, etc.
167167

168168
Example:
169169

170-
```jsx
170+
```javascript
171171
createMapOptions: function (maps) {
172172
return {
173173
panControl: false,
@@ -181,23 +181,23 @@ createMapOptions: function (maps) {
181181
```
182182
See "Custom map options example" in Examples below for a further example.
183183

184-
####onClick (func)
184+
#### onClick (func)
185185

186186
`(x, y, lat, lng, event)`
187187

188188
The `event` prop in args is the outer div onClick event, not the gmap-api 'click' event.
189189

190190
Example:
191191

192-
```jsx
192+
```javascript
193193
_onClick = ({x, y, lat, lng, event}) => console.log(x, y, lat, lng, event)
194194
// ES5 users
195195
function _onClick(obj){ console.log(obj.x, obj.y, obj.lat, obj.lng, obj.event);}
196196

197197
<GoogleMap onClick={_onClick} ... />
198198
```
199199

200-
####onBoundsChange (func)
200+
#### onBoundsChange (func)
201201

202202
```
203203
(center, zoom, bounds, marginBounds)
@@ -207,30 +207,30 @@ Example:
207207
[topLat, leftLng, bottomLat, rightLng] = bounds;
208208
```
209209

210-
####onChildClick (func)
210+
#### onChildClick (func)
211211

212-
####onChildMouseEnter (func)
212+
#### onChildMouseEnter (func)
213213

214-
####onChildMouseLeave (func)
214+
#### onChildMouseLeave (func)
215215

216-
####onZoomAnimationStart (func)
216+
#### onZoomAnimationStart (func)
217217

218-
####onZoomAnimationEnd (func)
218+
#### onZoomAnimationEnd (func)
219219

220-
####distanceToMouse (func)
220+
#### distanceToMouse (func)
221221

222-
####googleMapLoader (func)
222+
#### googleMapLoader (func)
223223

224-
####onGoogleApiLoaded (func)
224+
#### onGoogleApiLoaded (func)
225225
Directly access the maps API - *use at your own risk!*
226226

227-
```jsx
227+
```javascript
228228
<GoogleMap onGoogleApiLoaded={({map, maps}) => console.log(map, maps)} />
229229
```
230230

231231
To prevent warning message add _yesIWantToUseGoogleMapApiInternals_ property to GoogleMap
232232

233-
```jsx
233+
```javascript
234234
<GoogleMap onGoogleApiLoaded={({map, maps}) => console.log(map, maps)}
235235
yesIWantToUseGoogleMapApiInternals
236236
/>
@@ -250,7 +250,7 @@ Longitude to place the marker component
250250
GoogleMap passes a $hover prop to hovered components. To detect hover it an uses internal mechanism, explained in x_distance_hover example
251251

252252
Example:
253-
```jsx
253+
```javascript
254254
render() {
255255
const style = this.props.$hover ? greatPlaceStyleHover : greatPlaceStyle;
256256

@@ -261,11 +261,11 @@ render() {
261261
);
262262
}
263263
```
264-
265-
264+
265+
266266
## Utility functions
267267

268-
####fitBounds (func)
268+
#### fitBounds (func)
269269
Use fitBounds to get zoom and center.
270270

271271
Example:
@@ -292,11 +292,11 @@ const size = {
292292
const {center, zoom} = fitBounds({nw, se}, size);
293293
```
294294

295-
####tile2LatLng (func)
295+
#### tile2LatLng (func)
296296

297-
####latLng2Tile (func)
297+
#### latLng2Tile (func)
298298

299-
####getTilesIds (func)
299+
#### getTilesIds (func)
300300

301301
## Tips
302302

@@ -306,7 +306,7 @@ Initially any map object has its top left corner at lat lng coordinates. It's up
306306

307307
Example (centering the marker):
308308

309-
```jsx
309+
```javascript
310310
const MARKER_SIZE = 40;
311311
const greatPlaceStyle = {
312312
position: 'absolute',
@@ -317,7 +317,7 @@ const greatPlaceStyle = {
317317
}
318318
```
319319

320-
```jsx
320+
```javascript
321321
render() {
322322
return (
323323
<div style={greatPlaceStyle}>
@@ -331,7 +331,7 @@ render() {
331331

332332
If at the moment of GoogleMap control created, a modal has no size (width,height=0) or/and not displayed, the simple solution is to add something like this in render:
333333

334-
```jsx
334+
```javascript
335335
render() {
336336
return this.props.modalIsOpen
337337
? <GoogleMap />

0 commit comments

Comments
 (0)