143 Commits

Author SHA1 Message Date
Michael Diego
aa10167eb8
Change componentWillReceiveProps to componentDidUpdate (#950) 2020-09-25 21:53:11 +02:00
Michael Diego
b25dea10fc
Fix key not being set in bootstrapURLKeys (#948) 2020-09-23 01:14:00 +02:00
Michael Diego
1ce0ef6f2f
Use @googlemaps/js-api-loader and fix libraries usage (#946)
Co-authored-by: Justin <jpoehnelt@google.com>
Co-authored-by: Aviya Developer <aviya.developer@gmail.com>
2020-09-22 18:59:12 +02:00
Michael Diego
25b1646a2d
Reverts PR #921 to fix #931 (#933)
* Revert "Fix heatmapLibrary"

This reverts commit 8e67c08c275ea611e1a8d193c6888a312b47cafb.

* Revert "Update API.md"

This reverts commit 2d55cedfdd67b5410261f677f17c2d0969485757.

* Revert "Added all google maps api libraries to api loader (#921)"

This reverts commit 1718a4a9415e1422752f3ae68c8b7119af6ca8db.
2020-09-01 05:17:53 +02:00
Michael Diego
9e06d200b1
Produce CommonJS and UMD bundles (#932) 2020-09-01 05:05:06 +02:00
Michael
8e67c08c27 Fix heatmapLibrary 2020-08-31 06:48:17 +02:00
aviyadeveloper
1718a4a941
Added all google maps api libraries to api loader (#921)
* Added all google maps api libraries to api loader

Supports places, visualization, places, and geomerty libs.
keeps support for previous heatMapLibrary prop to avoid breaking older usage.

* add libraries to props of GoogleMap

* Update google_map.js

* add warning about heatMapLibrary

* heatmap depreaction, clean libraries, docs

* clean up google map prop
2020-08-31 02:27:50 +02:00
Michael
1cae88eb5d Fix default imports 2020-07-31 02:59:47 -03:00
Dirk Rusche
75613cb7cd
Fix options not updated bug (#878)
Co-authored-by: Michael Diego <6419886+itsmichaeldiego@users.noreply.github.com>
2020-07-30 08:12:12 -03:00
Afzal Hossain
a65411f9d6
On resize it's getting undefined minZoom (#864) 2020-07-30 06:34:06 -03:00
Brandon DeMello
307476f02e
Moves marker dispatcher binds to componentDidMount (#873) 2020-07-30 06:31:45 -03:00
Michael Diego
b3bc11c215
Rewrite library using create-react-library (#900)
* Rewrite library using create-react-library
* Export utils properly
* Remove unnecessary code and fix eslintignore
* Update CHANGELOG
2020-07-25 03:03:03 -03:00
Michael Diego
c35f73569c
Update dependencies and fix develop env (#897)
* Upgrade packages
* Update yarn.lock
* Fix warnings
* Fix sass dependencies
* Fix sass modules
2020-07-24 01:54:20 -03:00
Eniz Gülek
42617c99c3 Updated China base url (#827) 2020-01-27 12:51:13 -03:00
Kevin Ramsunder
59290615be Add shouldUnregisterMapOnUnmount prop to persist map object on unmount (#759) 2019-09-20 19:43:04 +02:00
Eric Neo
260c6d1c76 Add prop 'onDragEnd' (#754) 2019-09-20 19:42:29 +02:00
Joe Maffei
f5bb716291 Add UNSAFE_ prefix to deprecated lifecycle methods (#778)
* add UNSAFE_ prefix to deprecated lifecycle methods

* add missing line break
2019-09-20 19:41:26 +02:00
Eric Neo
94fcc3e541 Pass zoom value to zoom animation callbacks (#742) 2019-05-14 12:54:23 -03:00
Michael Diego
de2cca6c16
Revert "Add shouldUnregisterMapOnUnmount prop to persist map object on unmount (#722)" (#739)
This reverts commit 40fe3ead1d82cb01447100c1fb9f8008e38f366a.
2019-04-03 10:22:03 -03:00
Michael Diego
c6767e24f5
Revert "Google Map loader respecting the app language change (#726)" (#738)
This reverts commit 55fd1b06a375e2126e8dea95d5f32943f4009553.
2019-04-03 10:19:42 -03:00
Michael Salaverry
3d78dd9cb4 Fix: Update heatmap layer when heatmap positions prop changes (#728)
* improvement: switched from defining API key in multiple places to one place

* now generating random readings

* fix: a change in heatmap positions now updates the map accordingly

* docs: added comment to explain that the developer should use their own key
2019-04-01 12:47:19 -03:00
Tom Wagner
55fd1b06a3 Google Map loader respecting the app language change (#726) 2019-03-20 15:42:09 -03:00
Kevin Ramsunder
40fe3ead1d Add shouldUnregisterMapOnUnmount prop to persist map object on unmount (#722) 2019-03-18 14:29:52 -03:00
Artem Artemyev
45ecda13e6 Added React 16 createPortal with backwards compatibility (#696)
* added react 16 createPortal support with backwards compatibility

* fixed lint errors
2018-12-18 13:02:16 -03:00
Michael Diego
d8d9dc3b63
Revert "Added feature: update heat map on data change + fix linting" (#679)
* Revert "Bump version to 1.1.0 (#671)"

This reverts commit 1603e3afea4cd0fdb88e7b5479f1f3321908afb4.

* Revert "Added feature: update heat map on data change + fix linting (#593)"

This reverts commit 1ce8726fda4cd56694680051125dd107c2817528.
2018-11-21 18:11:50 +01:00
Donovan De Smedt
1ce8726fda Added feature: update heat map on data change + fix linting (#593)
* Added feature: update heat map on data change

When prop updateHeatmap is set to true --> map will rerender.
- New render of <GoogleMapReact> and data is changed, prop updateHeatmap should be true
- New render of <GoogleMapReact> and data is not changed, prop updateHeatmap should be false

* Supports multiple google map libraries + update heatmap when prop updateHeatmap equals true

* Updated this.props -> nextProps (rookie mistake...)

* Updated API documentation:
- added info about the use of other libraries in the Google Map API
- added info about the updateHeatmap prop
2018-11-08 15:20:30 +03:00
Dmitry Bogomya
4a92a42902 Pass map instance to onDrag handler (#656) 2018-11-08 15:20:12 +03:00
Max Chernin
f73e774a45 add math abs to avoid negative values when calculating zoom (#655)
* add math abs to avoid negative values when calculating zoom

* add math.abs with proper styling to pass tests

* add math.abs to dx\dy on fitbounds
2018-11-08 15:19:33 +03:00
Jurgis Kacens
53e0979acb Custom div style options (#634)
* Custom div style options

* fix es-lint issue

* props naming fix

* docs update

* words
2018-09-29 12:37:08 +03:00
Michael Diego
317b5c0999
Revert 643 fix/map context (#645)
* Revert "Bump version to 1.0.7 (#644)"

This reverts commit 800092ae6f57648cf0ed74625a90752283ac1af4.

* Revert "Add passive scroll (#631)"

This reverts commit 40c8f67e78c1b851f5d35ef832ff5ef728db86af.

* Revert "Use React 16 portal to render map overlay (#643)"

This reverts commit b121bb673e9dae5ae558c8c98218f7fc02029da2.
2018-09-21 12:51:04 +03:00
Martin Jujou
40c8f67e78 Add passive scroll (#631)
* Add passive scroll

* Reworked code
2018-09-20 20:28:23 +03:00
Curtis Layne
b121bb673e Use React 16 portal to render map overlay (#643)
* Use React 16 portal to render map overlay

This allows the new context API to propagate context properly.

* Rename div to overlay
2018-09-20 20:20:22 +03:00
Jonathan Weiß
6d142cb10c Add prop onTilesLoaded (#615)
* Add prop `onTilesLoaded`

* (Adjust package name

* Increase version

* Make linter happy

* Remove scope from package name and reset version number

* Add description for new prop

* Remove "directories" entry

* Correct changelog

* Remove section header

* v2.0.0

* Revert version number

* Only listen to event if prop is used
2018-08-03 09:49:35 +02:00
Stephen Farrar
55f134c60c Fix typo, and call fromContainerPixelToLatLng() as you would expect. (#620) 2018-08-03 09:48:12 +02:00
Stephen Farrar
6c60a536d0 Remove marker jiggle. (#603)
Position the markers relative to the map panes.
Don't position the element that contains the markers.
Renamed all the geo service projection methods, for clarity.
2018-06-26 23:27:32 +03:00
Michael Diego
a73629b389
Fix build (#605)
* Fix build by updating yarn

* Fix lint

* Fix build by adding react-dom to devDependencies

* Fix lint again
2018-06-22 16:44:26 +03:00
Jeffrey Auriemma
99c3c847bb Add guard around mapDom event listener (#594)
Fixes an issue where, even if the end user has a proper google maps API
mock, the GoogleMaps component will throw an error when in a test
env.  ReactDOM.findDOMNode(this.googleMapDom_) returns `null`.

This commit wraps the subsequent addEventListener call in an `if` block,
ensuring that an empty DOM doesn't add complications to test suites
2018-05-31 16:30:27 -03:00
Alexander Sundli-Härdig
d6576f226f Avoid null error (#570)
Avoid the error "Cannot read property 'removeEventListener' of null"
2018-05-25 07:05:45 -03:00
Matt Togstad
92b502bd2d Option to position and size components with two corners. (#580)
* Option to position components with two corners.

This lets you lock a component to a specific bounding rectangle, which allows for precise tiling during zoom.

* Add a comment explaining two point positioning.
2018-05-16 23:56:31 -03:00
Donovan De Smedt
4faeeef56d added feature to add weights to the heatmap (#572) 2018-05-08 19:09:13 -03:00
Stephen Farrar
7877008e17 Fix zoom animation for v3.32 (#559)
* Use the experimental version, to get the new zoom animation.

* Don't use bounds for rendering in 3.32

* Revert the project() and unproject() methods.

Instead, add a new method fromLatLngToContainerPixel() to geo service.

* No need of setting .exp, that is by default

* Comments explaining the significance of API v3.32

* Add _VERSION to const
2018-04-27 16:48:01 -03:00
Michael Diego
aec0c08aae
Fix code styling in develop (#564) 2018-04-18 15:11:47 -03:00
kal
147997c5f7 added if statement in onRemove() function (#555)
Added an if statement in onRemove() function that checks if "this.div" is defined before calling ReactDOM.unmountComponentAtNode(this.div). This is done to avoid throwing an "unmountComponentAtNode(...): Target container is not a DOM element" error. I ran into this error while using google-map-react with React Router and switching between tabs rapidly to stress test my application.
2018-04-17 14:20:09 -03:00
Michael Diego
486bccfc61
Use shallowEqual and isEmpty as much as possible (#540)
* Use shallowCompare to compare objects

* Use isEmpty as much as possible

* Use our own shallowEqual

* Remove fbjs

* Just disable necessary line

* Add eslint-disable where needed
2018-03-13 16:59:11 -07:00
Michael Diego
8cb6939e6c
Remove lodash and use our own utils (#535)
* Use pure reduce and map functions

* Use only isEmpty from lodash

* Create our own isEmpty, don't use lodash

* Normalize utils names

* Group utils together

* Proper checking, better this way

* Set default value to options
2018-03-12 15:56:22 -07:00
Michael Diego
1ad4402462
Refactor code style (#533)
* Run eslint

* Avoid DRY in importing

* Update recompose

* Unnecessary backticks

* Update comments

* Move api-path into a variable

* Rename queryString to params

* Proper eslint-disable
2018-03-11 12:16:58 -07:00
Alex Leon
e4fa5ff822 call zoomControlClickTime on all clicks (#211)
* call zoomControlClickTime on all clicks

* Update google_map.js
2018-03-10 13:57:34 -08:00
Michael Diego
0413648b22
Set latest release version as default if user does not specify a version. (#530)
* Move URL logic to a better place

* DRY

* Set release version as default version

* Actually, lets be careful and set v to 3.31
2018-03-10 13:57:05 -08:00
Michael Diego
faf67e5e0e
Accept 0 as zoom value. (#525)
* Accept zoom being 0

* If we set a minZoom, its clear that we want to override it

* Oops! Wrong operators
2018-03-09 11:08:46 -08:00
Fumiya Karasawa
4a071767ff fix error about fromLatLngToDivPixel (#517)
* fix error about fromLatLngToDivPixel

fix "Cannot read property 'fromLatLngToDivPixel' of undefined" #257

* skip only the code that relates to div or overlay
2018-02-23 11:15:02 -08:00