Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RECOMMENDED fix OverlayView #954

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions lib/components/GoogleMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ var Map = (exports.Map = (function(_React$PureComponent) {
},

/*
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
*/
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
*/
},
])

Expand Down Expand Up @@ -317,14 +317,13 @@ var Map = (exports.Map = (function(_React$PureComponent) {
},
])
return Map
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/

Map.displayName = "GoogleMap"
Map.propTypes = {
Expand Down
21 changes: 11 additions & 10 deletions lib/components/GroundOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,26 @@ var GroundOverlay = (exports.GroundOverlay = (function(_React$PureComponent) {
},
])
return GroundOverlay
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

GroundOverlay.propTypes = {
/**
* @type string
*/
defaultUrl: _propTypes2.default.string /* v10.0.0 .isRequired */ /**
defaultUrl: _propTypes2.default.string /* v10.0.0 .isRequired */
/**
* @see https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay
*/,

defaultBounds: _propTypes2.default.object /* v10.0.0 .isRequired */ /**
defaultBounds: _propTypes2.default.object /* v10.0.0 .isRequired */
/**
* @type string
* @deprecated use `defaultUrl` instead. It will be removed in v10.0.0
*/,
Expand Down
13 changes: 7 additions & 6 deletions lib/components/InfoWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ var _inherits2 = require("babel-runtime/helpers/inherits")

var _inherits3 = _interopRequireDefault(_inherits2)

var _InfoWindow$contextTy /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
var _InfoWindow$contextTy
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

var _invariant = require("invariant")
Expand Down
13 changes: 7 additions & 6 deletions lib/components/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ var _inherits2 = require("babel-runtime/helpers/inherits")

var _inherits3 = _interopRequireDefault(_inherits2)

var _Marker$contextTypes /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
var _Marker$contextTypes
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

var _react = require("react")
Expand Down
36 changes: 17 additions & 19 deletions lib/components/OverlayView.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ var _bind2 = require("lodash/bind")

var _bind3 = _interopRequireDefault(_bind2)

var _OverlayView$contextT /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
var _OverlayView$contextT
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

var _invariant = require("invariant")
Expand Down Expand Up @@ -128,28 +129,25 @@ var OverlayView = (exports.OverlayView = (function(_React$PureComponent) {
value: function onAdd() {
this.containerElement = document.createElement("div")
this.containerElement.style.position = "absolute"
},
},
{
key: "draw",
value: function draw() {

_reactDom2.default.render(this.props.children, this.containerElement)

var mapPaneName = this.props.mapPaneName

;(0, _invariant2.default)(
!!mapPaneName,
"OverlayView requires either props.mapPaneName or props.defaultMapPaneName but got %s",
mapPaneName
)
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapPanes

var mapPanes = this.state[_constants.OVERLAY_VIEW].getPanes()
mapPanes[mapPaneName].appendChild(this.containerElement)

_reactDom2.default.unstable_renderSubtreeIntoContainer(
this,
_react2.default.Children.only(this.props.children),
this.containerElement,
this.onPositionElement
)
},
},
{
key: "draw",
value: function draw() {
this.onPositionElement()
},
},
{
Expand Down
15 changes: 7 additions & 8 deletions lib/components/StreetViewPanorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,13 @@ var StreetViewPanorama = (exports.StreetViewPanorama = (function(
},
])
return StreetViewPanorama
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/

StreetViewPanorama.propTypes = {
/**
Expand Down
12 changes: 6 additions & 6 deletions lib/components/addons/InfoBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ var InfoBox = (exports.InfoBox = (function(_React$PureComponent) {
key: "componentWillMount",

/*
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#InfoBox
*/
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#InfoBox
*/
value: function componentWillMount() {
if (!_canUseDom2.default || this.state[_constants.INFO_BOX]) {
return
}

var _require = require(/* "google-maps-infobox" uses "google" as a global variable. Since we don't
* have "google" on the server, we can not use it in server-side rendering.
* As a result, we import "google-maps-infobox" here to prevent an error on
* a isomorphic server.
*/ "google-maps-infobox"),
* have "google" on the server, we can not use it in server-side rendering.
* As a result, we import "google-maps-infobox" here to prevent an error on
* a isomorphic server.
*/ "google-maps-infobox"),
GoogleMapsInfobox = _require.InfoBox

var infoBox = new GoogleMapsInfobox()
Expand Down
13 changes: 7 additions & 6 deletions lib/components/addons/MarkerWithLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ var _inherits2 = require("babel-runtime/helpers/inherits")

var _inherits3 = _interopRequireDefault(_inherits2)

var _MarkerWithLabel$cont /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
var _MarkerWithLabel$cont
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

var _react = require("react")
Expand Down
15 changes: 7 additions & 8 deletions lib/components/drawing/DrawingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,13 @@ var DrawingManager = (exports.DrawingManager = (function(_React$PureComponent) {
},
])
return DrawingManager
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

DrawingManager.propTypes = {
Expand Down
19 changes: 9 additions & 10 deletions lib/components/places/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ var SearchBox = (exports.SearchBox = (function(_React$PureComponent) {
key: "handleInitializeSearchBox",
value: function handleInitializeSearchBox() {
/*
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
*/
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
*/
var searchBox = new google.maps.places.SearchBox(
this.containerElement.querySelector("input")
)
Expand Down Expand Up @@ -274,14 +274,13 @@ var SearchBox = (exports.SearchBox = (function(_React$PureComponent) {
},
])
return SearchBox
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

SearchBox.propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/places/StandaloneSearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ var SearchBox = (function(_React$PureComponent) {
)
var element = _reactDom2.default.findDOMNode(this)
/*
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
*/
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
*/
var searchBox = new google.maps.places.SearchBox(
element.querySelector("input") || element
)
Expand Down
15 changes: 7 additions & 8 deletions lib/components/visualization/HeatmapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,13 @@ var HeatmapLayer = (exports.HeatmapLayer = (function(_React$PureComponent) {
},
])
return HeatmapLayer
})(
_react2.default.PureComponent
)) /*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
})(_react2.default.PureComponent))
/*
* -----------------------------------------------------------------------------
* This file is auto-generated from the corresponding file at `src/macros/`.
* Please **DO NOT** edit this file directly when creating PRs.
* -----------------------------------------------------------------------------
*/
/* global google */

HeatmapLayer.propTypes = {
Expand Down
30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
},
"homepage": "https://tomchentw.github.io/react-google-maps/",
"main": "lib/index.js",
"files": ["types/index.d.ts", "lib/", "src/", "CHANGELOG.md"],
"files": [
"types/index.d.ts",
"lib/",
"src/",
"CHANGELOG.md"
],
"keywords": [
"React",
"Google",
Expand Down Expand Up @@ -55,24 +60,21 @@
"test:once": "cross-env CI=true npm test",
"build:src": "babel-node src/tx/jscodeshift",
"precommit:src": "npm run build:src && npm run dtslint",
"commit:src":
"git add -A && git commit -m 'chore(src/components): compile from src/macros with `babel`'",
"commit:src": "git add -A && git commit -m 'chore(src/components): compile from src/macros with `babel`'",
"prebuild:lib": "rimraf lib",
"build:lib":
"cross-env NODE_ENV=production babel src --out-dir lib --ignore macros,tx,spec.js",
"build:lib": "cross-env NODE_ENV=production babel src --out-dir lib --ignore macros,tx,spec.js",
"precommit:lib": "npm run build:lib",
"commit:lib":
"git add -A && git commit -m 'chore(lib): compile from src with `babel`'",
"commit:lib": "git add -A && git commit -m 'chore(lib): compile from src with `babel`'",
"precommit:docs": "npm run styleguide:build",
"commit:docs":
"git add -A && git commit -m 'docs: compile from src with `styleguidist`'",
"prerelease":
"npm run commit:src && npm run commit:lib && npm run commit:docs",
"release":
"standard-version -m 'chore(release): %s \n\n* CHANGELOG: https://github.com/tomchentw/react-google-maps/blob/v%s/CHANGELOG.md'"
"commit:docs": "git add -A && git commit -m 'docs: compile from src with `styleguidist`'",
"prerelease": "npm run commit:src && npm run commit:lib && npm run commit:docs",
"release": "standard-version -m 'chore(release): %s \n\n* CHANGELOG: https://github.com/tomchentw/react-google-maps/blob/v%s/CHANGELOG.md'"
},
"lint-staged": {
"*.{js,jsx,json,css}": ["prettier --write", "git add"]
"*.{js,jsx,json,css}": [
"prettier --write",
"git add"
]
},
"babel": {
"plugins": [
Expand Down
Loading