Comments (1)
Year have passed, but i'm gonna answer anyway.
Just set map reference on init, and then refer to it and use just native google maps api according to their docs, here's simplified example:
import { useEffect, useRef } from 'preact/hooks';
import GoogleMapReact from 'google-map-react';
const CustomMap = () => {
const mapRef = useRef(null);
useEffect(() => {
mapRef.current &&
mapRef.current.setCenter({ lat: 10, lng: 20 });
}, []);
return (
<div>
<GoogleMapReact
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map }) => {
mapRef.current = map;
}}
>
</GoogleMapReact>
</div>
);
};
export default CustomMap;
from old-examples.
Related Issues (20)
- resetBoundsOnResize not working HOT 1
- API doc need more work and info
- Error: Cannot find module "react/addons" HOT 1
- Pins Move In Full-Screen Mode HOT 4
- Question: When to use translate3d HOT 2
- Component directions ?
- Bug, custom pins move on zoom HOT 1
- Cannot read property '_' of undefined HOT 1
- github.io example site does work, missing API keys
- unnecessary renders caused by marker? HOT 2
- What is it?
- Can't implement Styling Wizard HOT 3
- Center is an object property , please change.
- Markers do not keep their place HOT 3
- marker event does not fire in `map`
- Hide businesses
- is there a way to set auto-zoom based on the center latlng? so that all the points are visible
- How to get current zoom size?
- Error when starting the project for the first time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from old-examples.