Giter VIP home page Giter VIP logo

Comments (9)

tomchentw avatar tomchentw commented on June 10, 2024

Since this issue has been mentioned over and over again, I was thinking if we should make <GoogleMaps> a component like <input>. IE, they can have a controlled state and uncontrolled state. For most usage, uncontrolled <GoogleMaps> is enough. But that requires us to put the config into props.defaultConfig or something ...

from react-google-maps.

ryvasquez avatar ryvasquez commented on June 10, 2024

👍 @tomchentw Is there any snippet can you provide or example?

from react-google-maps.

khoerling avatar khoerling commented on June 10, 2024

+2

from react-google-maps.

wuct avatar wuct commented on June 10, 2024

👍
@ryanannatuvasquez It has not been implemented, yet. According to React doc, I believe it will be something like below:

<GoogleMaps
  defaultZoom={3}
  defaultCenter={{lat: -25.363882, lng: 131.044922}} />

from react-google-maps.

tomchentw avatar tomchentw commented on June 10, 2024

Thanks @wuct ! This is exactly what I'd expect. Please leave any feedback here.
@ryanannatuvasquez @khoerling @tybro0103

from react-google-maps.

ryvasquez avatar ryvasquez commented on June 10, 2024

@tomchentw I came up with temporary solution, having zoomLevel and location state, the zoomLevel updates in onZoomChanged event and onDragend event for location.

from react-google-maps.

tomchentw avatar tomchentw commented on June 10, 2024

@ryanannatuvasquez That's the standard ("React") way to handle internal state of a component. Good job!

from react-google-maps.

tomchentw avatar tomchentw commented on June 10, 2024

Please move discussions to #88, thanks. Close this now.

from react-google-maps.

tomchentw avatar tomchentw commented on June 10, 2024

Released v2.0.0 and v2.0.1.

from react-google-maps.

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.