108 Commits

Author SHA1 Message Date
Michael Diego
aa10167eb8
Change componentWillReceiveProps to componentDidUpdate (#950) 2020-09-25 21:53:11 +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
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
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 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
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
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
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
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
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
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
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
ZAKdev
e50f1d825b Added heatmap functionality (#441)
* Added functionality of heatmap

* Added options for heatmap

* default heatmap prop change to object

* resolve linting issues

* resolve linting

* Added demo for heatmap

* Fixed eslint

* Added heatmapLibrary prop for enable and disable visualization library for components

* Fixed linting

* Added heatmapLibrary={true} in all map components

* Fixed proptypes error

* Added heatmap in README with example code

* removed api key from heatmap component

* Removed unnecessary props from heatmap component
2018-02-12 14:09:38 -08:00
Ondrej Mladek
e47d955a90 Add fullscreen check for Internet explorer 11 (#485)
* Add fullscreen check for Internet explorer 11

Fixing marker position in Internet Explorer 11 in fullscreen mode.
Fixing: https://github.com/istarkov/google-map-react/issues/484

* #484: move fullscreen check to function

* #484 eslint fix
2018-01-04 15:12:01 +01:00
Acellam Guy
7814901c64 notify call back of load failure (#479)
When the google  fails to load due to no internet, the  call back should be notified so that appropriate UI can be shown
2017-12-28 07:42:30 -03:00
Joseph Frazier
0db8020122 Make resetBoundsOnResize preserve center when full-screened (#482)
* lockCenter prop added

* Resolve conflicts

* Fix lint with `yarn lint --fix`

* Add documentation for `lockCenter` prop

* Remove `lockCenter`, add its behavior to `resetBoundsOnResize`

See https://github.com/istarkov/google-map-react/pull/482/files#r158330791
2017-12-22 01:54:12 -03:00
jbcochery
9a418f6aa3 Fix markers position on fullscreen mode (#452) 2017-12-20 18:46:49 -03:00
Ivan Starkov
07368e23ad Move 2 yarn, add prettier, update linters (#360)
* Move 2 yarn, add prettier, update linters

* Fix linting error
2017-04-11 00:47:54 +03:00
Yoad Snapir
5c9d911e4f Fix unresponsive map after outside-click on a touch device with draggable:false (#335)
* Implement workaround fix for mouseout event on touch devices

* fix linting errors
2017-03-10 12:29:59 +03:00
Yoad Snapir
956c0ca5d2 Stop capturing all touch events and use built in google maps support (#334)
* Revert "Fix ipad dragging issue (#233)"
Using the built in support from google maps would make the component more
mobile friendly.

This reverts commit 7d1180c5427750e18411874f538ae6bfbbe33498.

* Improve documentation around touch device support

* Fix linting errors
2017-03-10 12:28:28 +03:00
cybice
438bc12296 Fix google api bug 2016-12-29 19:16:44 +03:00
cybice
3187822309 Fix remove listener 2016-12-29 18:57:35 +03:00
Marius Andra
4da59f0242 fix small typo (add -> remove) (#295) 2016-12-22 22:06:35 +03:00
Lukyanov Fedor
7a9a8d3fb7 Add ne and sw to bounds object (#287)
* Add ne and sw to bounds object

* Add ability to use ne and sw in fitBounds

* Return all corners from fitBounds

* Remove exports object in favour export
2016-11-30 23:13:19 +03:00
Andries Smit
496e9a5d7d Fix reference to maps instead of map. (#283)
Sorry, made a smal but ugly mistake in the last pull request.
The this.maps does not have a function getCenter .... but this.map does
2016-11-24 21:17:59 +03:00
Andries Smit
affee2a8dd Keep original center on _mapDomResizeCallback (#282)
When the resize event is triggered, the original center was lost. 
This issue is significant when the map is renders outside visible dom with zero height and width.
When placed into the visible dom, the resize is triggered correctly. With this change the center will persist. (Without this fix the old center is the top left corner)
2016-11-24 20:09:06 +03:00
Matt Dean
7be0f10591 expose map type callback (#275) 2016-11-24 20:05:30 +03:00
Ivan
6273309665 #add handlers for fly update layers (#272)
* #add handlers for fly update layers

* #remove force param

* Update google_map.js
2016-11-07 12:07:14 +03:00
alex-e-leon
d348c64f85 Fixed componentWillReceiveProps options function bug (#273)
Fixes a bug which prevented you from changing the function passed to
the options prop
2016-11-07 11:31:26 +03:00