November Happy Hour will be moved to Thursday December 5th.

Address Element Issue

Vote:
 

Hi guys,

I've noticed there's lack of documentation regarding the Forms Samples package, especially the Address element which I only noticed was part of the package after going through the Git repo.

When implementing the Address element block into a form container I receive a console error mentioning that the maps.google script is being requested over HTTP rather than HTTPS and thus breaking the script and not rendering the element as expected. I may have missed some setup/configuration but not quite sure due to the lack of documentation as mentioned, any help would be appreciated!

Many thanks,

David

#197925
Oct 17, 2018 11:38
Vote:
 

There is a setting in episerver section googleMapsApiV3Url you need enter your value to make it works. Something like below:

<episerver>
    <applicationSettings httpCacheability="Public" pageValidateTemplate="false" uiShowGlobalizationUserInterface="true" uiUrl="~/EPiServer/CMS/" urlRebaseKind="ToRootRelative" uiEditorCssPaths="~/Static/css/Editor.css" uiSafeHtmlTags="b,i,u,br,em,strong,p,a,img,ol,ul,li"
                         googleMapsApiV3Url="https://maps.googleapis.com/maps/api/js?libraries=places&key=YOUR_KEY" />

Rememeber to register map service in Google Cloud, enable mapjs and places apis then get your key to put on the url above.

#197926
Oct 17, 2018 12:00
Vote:
 

Hi Dac,

Thanks for that, seems to solve the problem!

However is there any chance we can modify that value within code, such as with an Initailization Module? We have both the URL and API key already as seperate values within our web.config and would be nice if we could reuse those values?

Thanks

#197928
Oct 17, 2018 12:36
Vote:
 

The package is opensource, feel free to modify and build the package yourself. You should modify the method GetExtraResources in AddressesElementBlock.

#197929
Oct 17, 2018 12:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.