Nasr1

GoogleMapApi show old Coordinate Values in the update form

Posted 1 year ago by Nasr1

Hello people, am building an update page for edit a user Information include its coordinates , this is a picture to clear things out :- http://imgur.com/a/hezWc

so in the edit form i able to produce the old values of the fields , but when it came to ,google map fields i did'nt able to since its Javescript and i have no idea how to do this , and am not even sure what to use to overwrite values of the coordinates ... this is my action methoed for the storing update info of the user :- public function update(Request $request,$id) { $loc = $request::get('loc'); $pickup_loc = $request::get('pickup_loc'); $dropoff_loc = $request::get('dropoff_loc'); $name = $request::get('name'); $password = $request::get('password'); $email = $request::get('email'); $mobileNo = $request::get('mobileNo'); $age = $request::get('age'); $gender = $request::get('gender'); $organizationId = $request::get('organizationId'); $busId = $request::get('busId');

            $user =\App\User::find($id);
            $user->name = $name;
            $user->password = \Illuminate\Support\Facades\Hash::make($password);
            $user->email = $email;
            $user->mobileNo = $mobileNo;
            $user->age = $age;
            $user->gender = $gender;
            $user->organizationId = $organizationId;
            $user->busId = $busId;
            $user->Location = $loc;
            $user->CheckInLocation = $pickup_loc;
            $user->CheckOutLocation = $dropoff_loc;
            
            $user->save();
            Session::flash('success','The User Was Successfully Updated');
            return 'updated test successed';
        }

and this is edit form tag that responsible to get the coordinates of google map :-

     <div class="form-group">
        <label class="control-label col-md-2" for="Locations">Locations</label>
        <div class="col-md-10">
            <button id="stop_btn" disabled="disabled" class="btn btn-default"                                               
          onclick="locationClick();this.disabled = 'disabled';">Location</button>
            <button id="pick_btn" class="btn btn-info" onclick="pickClick(); 
    this.disabled = 'disabled';">Pickup Location</button>
            <button id="drop_btn" class="btn btn-danger" onclick="dropClick(); this.disabled =              
                         'disabled';">Dropoff Location</button>
            <div id="map" value="{{ $user->CheckOutLocation }}"></div>

                   </div>
                    </div>

please help me guys , i know that its not much related with laravel more than javescript , so any thing would be cool even tips would be great. , and thanks in advance

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.