Hello,
I am trying to use the Google Places API autocomplete on the same page in conjunction with the OutSystems Maps application.
But depending on the loading order, I will get a map with no markers and autofill working, or a correct map displayed with markers and no autocomplete.
I thought this could be because the same script is being loaded twice.
Updating the code for the OutSystems Maps App seems to work:
script.src = 'https://maps.googleapis.com/maps/api/js?key=' + apiKey;
to
script.src = 'https://maps.googleapis.com/maps/api/js?libraries=places&key=' + apiKey;
But I would not like to miss updates from Forge.
Is there any procedure I can do to solve this problem?
Or would it be possible to add in an upcoming update the option to include other APIs (drawing, geometry, localContext, places, visualization)?
Thank you for your help.
Hi @Geertjan Jacobs
This is basically the same as explained here.Also, any particular reason why you're not using the Search Places from OutSystems Maps? That would be really useful for us to understand how to improve that feature.
Cheers,GM
Hello @Sérgio Silva,
This is a very interesting use case.
For now we don't see any way you can achieve that without changing the url, but we'll analyze it carefully and it might become a functionality.
We would be very glad if you could share some of the use cases you need to understand what libraries would make sense to be able to include.
Thanks,
Bruno Martinho
Hello Bruno,
For now I'm using the Places library to search for the address.
For me, it would be great if the Places library was included as an option in the App OutSystemsMaps. However, I think that if this option is made available it may be interesting to include the other Google APIs.
This is the link to my application with the modified URL (script.src = 'https://maps.googleapis.com/maps/api/js?libraries=places&key=' + apiKey; ).
https://personal-fymqmmws.outsystemscloud.com/MapSample/Map
Below is a sample application of the user case I am developing.
Thanks!
Sérgio Silva.
Old post but is this solved/added yet?
I have the same use case of having the Google Autocomplete (Google Address Autocomplete React Forge component) and OutSystemsMaps (v1.6.6) with a marker on the same page.
A user can search for an address and is able to then finetune the location pin on the map.
This results in an error visible in Chrome console:
--------------------
You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
Either the Autocomplete works or the OutSystemsMaps marker, but not both.