Git Product home page Git Product logo

Comments (11)

danZheng1993 avatar danZheng1993 commented on May 18, 2024 4

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.

oScape avatar oScape commented on May 18, 2024 2

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.

auser avatar auser commented on May 18, 2024 1

from google-maps-react.

auser avatar auser commented on May 18, 2024

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.

Szarko avatar Szarko commented on May 18, 2024

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.

auser avatar auser commented on May 18, 2024

Sure. Wanna try a PR, @Szarko ?

from google-maps-react.

auser avatar auser commented on May 18, 2024

bump ^^

from google-maps-react.

TheMaverickProgrammer avatar TheMaverickProgrammer commented on May 18, 2024

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.

rhiroy avatar rhiroy commented on May 18, 2024

@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.

TheMaverickProgrammer avatar TheMaverickProgrammer commented on May 18, 2024

No I wrote my own

from google-maps-react.

ionutale avatar ionutale commented on May 18, 2024

No I wrote my own

hey @TheMaverickProgrammer can you publish the source code for the map component?

from google-maps-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.