Comments (11)
The best way to fix this issue is this.
Apply className to the Map component.
And then define css style to the class.
<Map className="miniMap"/>
In the css file define css rules to the miniMap class
.miniMap {
position: relative !important;
with: 100% !important;
height: 400px !important;
}
from google-maps-react.
Anyone know how to remove the width and height 100% on the parent div ?
I override the styles but it recreate a parent div to override my override.
from google-maps-react.
from google-maps-react.
Ah, yes... this is inside the component itself here: https://github.com/fullstackreact/google-maps-react/blob/master/src/index.js#L177
You can override this default or perhaps it makes sense to create an option to apply these styles conditionally.
What do you think?
from google-maps-react.
I think a flag that is passable to the option is a good idea, if it is passed false it will apply no styles from the source component.
Thank you for your response. Great work with this.
from google-maps-react.
Sure. Wanna try a PR, @Szarko ?
from google-maps-react.
bump ^^
from google-maps-react.
Did anyone fix this? I can't for the life of me set the position to 'relative'. Would fix all my problems. Tried changing the css, internal css, and it keeps forcing 'absolute'.
from google-maps-react.
@TheMaverickProgrammer did you manage to fix it? I struggled with this for a while but made it work. I took out the const style
from Container
and just put style={{height: '100vh', width: '100vw'}}
directly into the render function in Map
, on the line above 'Loading map...." and below <div ref='map'>
from google-maps-react.
No I wrote my own
from google-maps-react.
No I wrote my own
hey @TheMaverickProgrammer can you publish the source code for the map component?
from google-maps-react.
Related Issues (20)
- How can I hide api key when inspecting on network? HOT 1
- cors error HOT 1
- prop-types should be a proper dependency
- Circle dragend event
- Unable to get marker coordinates on drag HOT 1
- Hide labels.text config on init Map
- is it possible to load geojson HOT 1
- Pin Drag Method Of Google map
- npm ERR ! HOT 1
- React cant compile anymore
- Please Update npmjs.com package to 2.0.8 its still 2.0.6 HOT 13
- Draw a route on the map HOT 1
- How to get the Current Zoom value on the Map? Is there any function to that?
- What is the difference between bounds and marginBounds?
- getting blank page maps not rendered
- Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<InfoWindow> & Readonly<IInfoWindowProps>'
- Exposing Google Map API key HOT 2
- Style the marker
- Updated version published as @peacechen/google-maps-react
- Custom styles not beign applied to map HOT 1
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 google-maps-react.