google-maps-react-markers 2.0.0-alpha.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,8 +30,9 @@ The library implements [Google Maps Custom Overlays](https://developers.google.c
|
|
|
30
30
|
[](https://www.buymeacoffee.com/giorgiabosello)
|
|
31
31
|
[](https://www.paypal.me/giorgiabosello)
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
|
|
33
|
+
## 💬 Discussion
|
|
34
|
+
|
|
35
|
+
> **Released TypeScript version of the library!**
|
|
35
36
|
|
|
36
37
|
Feedbacks are welcome in [this discussion](https://github.com/giorgiabosello/google-maps-react-markers/discussions/109).
|
|
37
38
|
|
|
@@ -108,7 +109,7 @@ const App = () => {
|
|
|
108
109
|
lat={lat}
|
|
109
110
|
lng={lng}
|
|
110
111
|
markerId={name}
|
|
111
|
-
onClick={onMarkerClick}
|
|
112
|
+
onClick={onMarkerClick} // you need to manage this prop on your Marker component!
|
|
112
113
|
// draggable={true}
|
|
113
114
|
// onDragStart={(e, { latLng }) => {}}
|
|
114
115
|
// onDrag={(e, { latLng }) => {}}
|
|
@@ -164,6 +165,10 @@ export default App
|
|
|
164
165
|
For clustering, follow this [guide](https://www.leighhalliday.com/google-maps-clustering) using [useSupercluster Hook](https://github.com/leighhalliday/use-supercluster), but use bounds in this way:
|
|
165
166
|
|
|
166
167
|
```jsx
|
|
168
|
+
const [mapBounds, setMapBounds] = useState({
|
|
169
|
+
bounds: [0, 0, 0, 0],
|
|
170
|
+
zoom: 0,
|
|
171
|
+
})
|
|
167
172
|
const onMapChange = ({ bounds, zoom }) => {
|
|
168
173
|
const ne = bounds.getNorthEast()
|
|
169
174
|
const sw = bounds.getSouthWest()
|
|
@@ -218,4 +223,4 @@ MIT © [giorgiabosello](https://github.com/giorgiabosello)
|
|
|
218
223
|
<hr>
|
|
219
224
|
<p align="center">
|
|
220
225
|
Developed with ❤️ in Italy 🇮🇹
|
|
221
|
-
</p>
|
|
226
|
+
</p>
|