Skip to content

Commit b8273d3

Browse files
authored
Expand README.md
Fix table layout error, and expand instructions
1 parent 5ce6b80 commit b8273d3

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

js/contrib/README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ overlay.setMap(map);
2121
### Configuring the overlay
2222

2323
The options object specification is as follows:
24-
|Properties||
25-
|:--|:--|
26-
| **map** | **Type: [Map](https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map)**|
27-
| **minorGridDisplay** |**Type: boolean** Whether to display the minor grid and row/column grid labels. Defaults to **true**.|
28-
| **roadMapColor** |**Type: String** The stroke color to use for the grid lines over road or terrain maps. All CSS3 colors are supported except for extended named colors.|
29-
| **roadMapLabelClass** |**Type: String** The CSS class name to use for text labels over road or terrain maps. Defaults to **olc_overlay_text**.|
30-
| **satelliteMapColor** |**Type: String** The stroke color to use for the grid lines over satellite or hybrid maps. All CSS3 colors are supported except for extended named colors.|
31-
| **satelliteMapLabelClass** |**Type: String** The CSS class name to use for text labels over satellite or hybrid maps. Defaults to **olc_overlay_text**.|
24+
25+
| Properties ||
26+
|---|---|
27+
| **map** | **Type: [Map](https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map)** Map on which to display the overlay. |
28+
| **minorGridDisplay** |**Type: boolean** Whether to display the minor grid and row/column grid labels. Defaults to **true**. |
29+
| **roadMapColor** |**Type: String** The stroke color to use for the grid lines over road or terrain maps. All CSS3 colors are supported except for extended named colors. Defaults to #7BAAF7. |
30+
| **roadMapLabelClass** | **Type: String** The CSS class name to use for text labels over road or terrain maps. Defaults to **olc_overlay_text**. |
31+
| **satelliteMapColor** | **Type: String** The stroke color to use for the grid lines over satellite or hybrid maps. All CSS3 colors are supported except for extended named colors. Defaults to #7BAAF7. |
32+
| **satelliteMapLabelClass** | **Type: String** The CSS class name to use for text labels over satellite or hybrid maps. Defaults to **olc_overlay_text**. |
3233

3334
### Styling labels
3435
The text labels default to using the CSS class selector `.olc_overlay_text`. If there is no CSS style with that selector, one will be automatically added to the document. If you want to specify your own style, you should ensure it includes the following settings:
@@ -41,9 +42,9 @@ justify-content: center;
4142
flex-direction: column;
4243
```
4344

44-
It's a really good idea to use slightly different styles for the road and satellite maps with different text colors. This is because of the different colors used in the maps.
45+
It's a good idea to use slightly different styles for the road and satellite maps with different text colors. This is because of the different colors used in the map styles, so using different colors for the grids and labels improves legibility.
4546

46-
Here is an example of two styles:
47+
Here is an example of using separate styles:
4748
```html
4849
<style>
4950
.olc_label_road {
@@ -68,3 +69,17 @@ Here is an example of two styles:
6869
}
6970
</style>
7071
```
72+
73+
To use those styles, and use the same colors for the grid lines, create your overlay like this:
74+
75+
```javascript
76+
// After you have created the Google Maps object, instantiate
77+
// the grid overlay, passing it the map object.
78+
var overlay = new OLCGridOverlay({
79+
map: map,
80+
roadMapColor: '#7BAAF7',
81+
roadMapLabelClass: 'olc_label_road',
82+
satelliteMapColor: '#3376E1',
83+
satelliteMapLabelClass: 'olc_label_sat'
84+
});
85+
```

0 commit comments

Comments
 (0)