Google maps API key issues

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
1/31/2019 4:25:38 AM
Gravatar
Total Posts 10

Re: Google maps API key issues

Hi Joe,

Are you able to offer some assistance on the above please?

Regards

Andy

2/6/2019 6:11:29 AM
Gravatar
Total Posts 10

Re: Google maps API key issues

Hi Joe,

We really are stuck here and I would appreciate some help if you could afford the time.

As mentioned, we are now successfully upgraded to v2.7 of MP but we are still seeing the Google watermarks on the maps.

I have placed our API key in both the web.config of the site and in the API area of the CMS administration area.

The API key has had our current URL white-listed etc so that should be fine.

The upgrade caused other issue in customised areas of the solution but if we cannot get v2.7 to work with Google, then there will obviously be no appetite to upgrade and fix these

Please help

Regards

Andy

2/8/2019 2:49:48 PM
Gravatar
Total Posts 2253

Re: Google maps API key issues

Hi Andy,

Thank you for your patience. I apologize for the radio silence. We recently changed our email platform and in doing so we also changed our email client. It's a silly thing but we got completely side-tracked and the three of us that pay attention to mojoPortal forums didn't setup our new email client to show us the mojoPortal notifications (the new system pretty much hides all folders and requires you to manually "favorite" each one you want to see). Such a silly mistake that I'm afraid is going to affect us for a little while.

So, from what I'm gathering your not able to use Google Maps because the API Key apparently isn't being used properly. If you're using HTTP, it's all fine but when using HTTPS, it's showing the watermark. Is that all correct?

Some background: When we re-enabled the API key, we didn't have to do too much to make it work, just uncommented the line of code that had been commented out years ago when Google had gotten rid of the key.  We then, some months later and before releasing 2.7, figured out away to not need the API Key by utilizing the Google Maps embed functionality. We updated the code to offer UseIframe as an option and defaulted it to true in the features of mojoPortal that use the map. The iframe/embed method doesn't allow for other features of google maps (local search and driving directions for instance) but it makes using the maps very easy for regular site owners (i.e., they don't have to go get an API Key).

Looking at the code, in Web\Controls\Google\LocationMap.cs, I can see where HTTP vs HTTPS could be playing a role in what is going on with your site. If "EnableLocalSearch" is true, the API Key exists, and the current protocol is 'http', then we tell LocationMap.cs to use the Old Api (old as in really old v2). This is on lines 512-554.  That particular code actually didn't change at all since we took over the project (pre 2.5). 

If you don't need the Local Search functionality, I would suggest setting your instance of the locationMap control to UseIframe=true and seeing what that does for you. Google deprecated the LocalSearch feature a very long time ago so mojoPortal really shouldn't even give it as an option at this point, to be honest.

We're testing a new release right now but if we need to make some adjustments to make this work for you, we'll do that before releasing.

Again, thank you for your patience.

Best,
Joe Davis

You must sign in to post in the forums. This thread is closed to new posts.