I have been following this example here: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform which shows how to have a field that implements the auto complete dropdown with Google maps, and then when the user selects an address to fill out the individual form elements (Like street name etc..).
The address field will already be filled out in my case though so I just need to fill out the form elements when the page loads using this address.
I have tried
$(document).ready(function(){
fillInAddress();
});
To force it on start but the form elements stay empty. Does any one have any ideas?
Thanks in advance!
I think doing only fillInAddress(); might not be enough, you have to do something with the autocomplete too. However, since it is not open source or mentioned anywhere in the docs, there seems to be no way to do that.
One work around would be to use the Places web service API to get the same info. For more information about that please refer to this.
Related
i want to add google map places suggestion API on typeform specific search text field.
is there possible anyway? because i can not find any way like via JavaScript to embed JavaScript code on typeform or 2nd i try where used this form it's also prevent to return iframe content.
My understanding is that you want to use a google places autocomplete field directly inside a typeform.
Is that right?
At the moment this is not possible on Typeform platform.
One workaround could be an intermediary step before the typeform, like a static HTML page where you present the user with such a field, and pass this data as hidden field to the Typeform.
If you want to restrict people within a certain location to answer your typeform here are some other alternatives:
using google tag manager ask for user's location, and redirect them out of the typeform if it does not fit your requirements
intermediary step to ask for user location (via the browser) and redirect them to the typeform or not
implement Typeform logic on a zipcode or country field.
Hope it helps,
You can also contact Typeform support directly if you have more precise questions.
I am using protractor with Jasmine framework for automating angular5 application. My developers have used API/created google maps dropdown as mentioned in the link
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
When user types on the address, google maps API is invoked and lists the places related to search, this will not populate/change any tags of developer tools HTML. So basically when user types address then it will populate the address dropdown and I want to select any address either through mouse/keyboard arrow key. When I am automating, I could reach till passing string to the address web element later it errors saying
No details available for input:'Mumbai'
with the popup displayed on the window. Any help is greatly appreciated.
I tried below code,
browser.actions().mouseMove(element(by.id('fromAddress-input')).sendKeys("Mumbai")).perform();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
browser.actions().sendKeys(protractor.Key.ARROW_DOWN).perform();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
First you need to switch to the Iframe that contains the elements you want, use this to change to the Iframe:
var driver = browser.driver;
var loc = by.tagName('iframe');
var el = driver.findElement(loc);
browser.switchTo().frame(el);
Create a function with this code and place after you load the page.
Then your code will work but remove the first enter, do this for example:
browser.actions().mouseMove(element(by.id('fromAddress-input')).sendKeys("Mumbai")).perform();
browser.actions().sendKeys(protractor.Key.ARROW_DOWN).perform();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
change back to the main frame using this:
browser.switchTo().defaultContent();
Thanks to Dr.Molle cooments on my previous post, now, I know that we can filter displaying the addressControl. But what if I want to ONLY remove or update a part of the box.For example I want to keep the address line but remove the "Address Is Approximate" message since I am sure that I am in 100% correct address.Can you lease help me to figure this one out too?
Thanks
Don't try to modify the existing text. Add your own div or custom control containing only the address.
Update to address additional questions in comment:
Do I have to hard code the address in new custom div?
No.
Is there a way to grab address from addresscontrol?
I wouldn't think so. Where do you get the position of the panorama from? If it is an address, use that. If it is a position, you can get an approximate address by reverse geocoding the position (which is what I suspect Google is doing and why it says "address is approximate") Please post a complete example of your code (or at least enough of it to reproduce the behavior you are trying to change) if you want help with it.
Can you please help me to find a sample/ example of adding custom div containing address
on the top of map?
See the documentation on Custom Controls
I was having the same issue as you. The 'address control' on my embedded street view map was not appearing the same as it was in the Google Docs demo. In their demo the 'address control' had the address, a pin icon, and a 'View on Google Maps' link.
On my embedded map, the 'address control' only had the address and text below reading 'Address is Approximate'. At first I thought it was my lat/lng causing the issue but I tested my embed using the same values in the Google Docs demo and still had the issue.
What ended up fixing this issue for me was adding the signed_in=true parameter to my Google API script like so:
<script src="https://maps.googleapis.com/maps/api/js?signed_in=true&callback=initGoogleMaps" async defer></script>
Hopefully this will fix the issue for you!
I have a doubt which involves an auto in a DIV (in which contains the name of other users with their image and age) when a user type the letters in a field that is positioned above the DIV.
As the auto search of Facebook friends.
Searching, I found a jQuery plugin that is the 'Autocomplete' but I want to modify to have the same behavior as facebook friend finder.
Does anyone have any example to do this? Or another way?
Note: I have a function in PHP that returns me all the names by letter. ¿I can consistently with ajax call this function to update the DIV?
jQuery UI has some nice built in functionality for that
http://jqueryui.com/demos/autocomplete/
You can either go the javascript way when retrieving the suggestions or you could do the ajax calls - that depends mostly on how many entries you have that are possible matches.
If you have too many, storing all elements in js might not be the best way to go.
I have a situation where I need to have a user select a region from a dropdown box.
Depending on the region selected a search form will load with information relevant to the selected region.
I tried this:
stackoverflow.com/questions/3760920/jquery-dropdown-loading-content
Loading all the forms at once really slowed it down, and there seemed to be issues with the javascript used in the search forms when all were present at once.
I think the ideal solution would be to load/unload the search into a div. I've tried several tutorials with limited success.
My most recent attempt was this tutorial:
http://www.milaju.com/post/simple-ajax-content-changer-with-ezjax
The search itself works fine as seen here by itself:
http://test.medialayer.net/test/modules/one.html
But loaded inside a div the search fields don't populate.
http://test.medialayer.net/test/
Thanks for any and all assistance.
The problem is window.onload=checkDataLoad;. You use AJAX, window.onload won't work with that, simply use checkDataLoad(), and see window.onload equivalent for Ajax applications?