First at all, project is written in PHP with jQuery enabled.
The situation description might be like so: User can define his address. When user wants to add location of something (no matter what), user can choose, weather to use his defined address or choose new one. If he chooses new one, he can type it input as text.
Since I have to use Google Maps, it gets terrible hard to get it work. I want to display his defined address at first point, before choosing (defined/new) address (done, works great). If user leaves defined address, then no problems, Google maps stays as loaded. If user adds other address, I want to zoom out the map (done, works great), and after he finishes typing new address, then Google maps shows this newly typed one (nothing shows up).
Please, check my code below, so this text above would make a bit more sense...
And if you could help, please, do so :)
This is my HTML part:
<span><input type="checkbox" name="other_address" value="1"> I want to change address</span>
<input type="text" name="input_location" value="Bismarckallee 3, Freiburg" id="input_location" placeholder="Adress (Street, City)">
<input type="hidden" name="input_coordinates" value="47.997337,7.841653">
<div id="map_canvas" class="user_location_map" style="width: 100%; height: 300px;"></div>
This is my Javascript part (as its 73 lines, I used pastebin, not pasted in here):
http://pastebin.com/VyAHe90j
Thanks!
Try this -- you were missing a listener to update the map when you entered a new address:
http://pastebin.com/yraxkDmP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With