Skip to content

Commit f699679

Browse files
authored
Merge pull request #1 from fullstackreact/master
test
2 parents c70a04f + 5038ac4 commit f699679

28 files changed

+409
-2586
lines changed

.github/workflows/npmpublish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
- run: npm ci
16+
- run: npm test
17+
18+
publish-npm:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-node@v1
24+
with:
25+
node-version: 12
26+
registry-url: https://registry.npmjs.org/
27+
- run: npm ci
28+
- run: npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
31+
32+
publish-gpr:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: actions/setup-node@v1
38+
with:
39+
node-version: 12
40+
registry-url: https://npm.pkg.github.com/
41+
scope: '@your-github-username'
42+
- run: npm ci
43+
- run: npm publish
44+
env:
45+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ npm-debug.log
88
node_modules
99
.env
1010
public/
11+
dist

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,23 @@ const style = {
103103
height: '100%'
104104
}
105105
```
106-
initalCenter: Takes an object containing latitude and longitude coordinates. Sets the maps center upon loading.
106+
107+
Container Style: Takes CSS style object - optional, commonly when you want to change from the default of position "absolute".
108+
109+
```javascript
110+
const containerStyle = {
111+
position: 'relative',
112+
width: '100%',
113+
height: '100%'
114+
}
115+
```
116+
117+
```javascript
118+
<Map
119+
containerStyle={containerStyle}
120+
```
121+
122+
initialCenter: Takes an object containing latitude and longitude coordinates. Sets the maps center upon loading.
107123

108124
```javascript
109125
<Map
@@ -229,7 +245,7 @@ render() {
229245
}
230246
```
231247

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.
248+
The `<Map />` component also listens to `onRecenter`, `onBounds_changed`, `onCenter_changed`, `onDblclick`, `onDragstart`, `onHeading_change`, `onIdle`, `onMaptypeid_changed`, `onMousemove`, `onMouseout`, `onMouseover`, `onProjection_changed`, `onResize`, `onRightclick`, `onTilesloaded`, `onTilt_changed`, and `onZoom_changed` events. See Google Maps [Events](https://developers.google.com/maps/documentation/javascript/events) for more information.
233249

234250
### Visibility
235251

@@ -534,6 +550,45 @@ The `<Circle />` component listens to `onClick`, `onMouseover` and `onMouseout`
534550

535551
The `GoogleApiWrapper` automatically passes the `google` instance loaded when the component mounts (and will only load it once).
536552

553+
#### Custom Map Style
554+
555+
To set your own custom map style, import your custom map style in JSON format.
556+
557+
```javascript
558+
const mapStyle = [
559+
{
560+
featureType: 'landscape.man_made',
561+
elementType: 'geometry.fill',
562+
stylers: [
563+
{
564+
color: '#dceafa'
565+
}
566+
]
567+
},
568+
]
569+
570+
_mapLoaded(mapProps, map) {
571+
map.setOptions({
572+
styles: mapStyle
573+
})
574+
}
575+
576+
render() {
577+
return (
578+
<Map
579+
style={style}
580+
google={this.props.google}
581+
zoom={this.state.zoom}
582+
initialCenter={this.state.center}
583+
onReady={(mapProps, map) => this._mapLoaded(mapProps, map)}
584+
>
585+
...
586+
</Map>
587+
);
588+
}
589+
590+
```
591+
537592
## Manually loading the Google API
538593

539594
If you prefer not to use the automatic loading option, you can also pass the `window.google` instance as a `prop` to your `<Map />` component.

dist/GoogleApiComponent.js

Lines changed: 0 additions & 231 deletions
This file was deleted.

0 commit comments

Comments
 (0)