Coder Social home page Coder Social logo

Comments (7)

rameshsyn avatar rameshsyn commented on May 31, 2024

@ikhaled-ali Hello, thanks for the issue. It's a location picker component issue. I will fix it in v1.1.4.

from react-location-picker.

rameshsyn avatar rameshsyn commented on May 31, 2024

@ikhaled-ali It's fixed, update to v1.1.4

from react-location-picker.

ikhaled-ali avatar ikhaled-ali commented on May 31, 2024

@rameshsyn
Sorry for inconvenience .. but still not working after update ..
i'm also trying change it via click event but nothing was happen :(

from react-location-picker.

rameshsyn avatar rameshsyn commented on May 31, 2024

It should have worked.
Can you make sure react-location-picker version is v1.1.4 ?
Can i see your fetch code ? 🎃

from react-location-picker.

ikhaled-ali avatar ikhaled-ali commented on May 31, 2024

class EditEvent extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            error_page: "",
            position: {
                lat: 33.8199376507058,
                lng: 35.49130325317378
            },
            address: "Airport, Lebanon",
     }
   }
componentWillMount() {
    PostData("getEvent", event_id).then((repos) => {
                    // event not found
                    if (repos.ev_number === "NULL") {
                        this.showNotification("br", "danger", "ERROR", "Event not found!");
                        this.setState({event_id: 0, error_page: (<ErrorForm/>)});
                    } else { // event found
                        this.setState({event_id: event_id});
                        // set states values
                       position.lat = repos.position.lat;
                       position.lng = repos.position.lng;
                       address = repos.address;
                        this.setState({formData: initialFormData, position: position, address: address});
                    }
                }
}

}

Render :

<LocationPicker
                                                        containerElement={<div style={{height: '100%'}}/>}
                                                        mapElement={<div style={{height: '400px'}}/>}
                                                        defaultPosition={this.state.position}
                                                        onChange={this.handleLocationChange}
                                                    />

from react-location-picker.

rameshsyn avatar rameshsyn commented on May 31, 2024

@ikhaled-ali looks ok, latitude and longitude should be number. don't forget to coerce it to number in case it's number.
Is there any error in your browser console ? also make sure to include google map api key.

from react-location-picker.

rameshsyn avatar rameshsyn commented on May 31, 2024

@ikhaled-ali Here's demo for default position change https://codesandbox.io/s/qljl8y8nwq hope it help you.
You can update to v1.2.4, it's got two new features. 🚢

from react-location-picker.

Related Issues (11)

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.