Hexagon Geospatial
MENU

Support WebGIS

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 60
Registered: ‎11-17-2015

Google Maps in Geospatial Portal strange behaviour

Hi,

 

We have several customers using Geospatial Portal with Google Maps mashup. In the last few days a new problem arose: map tiles of Google have a mask saying "For development purpose only" (see image), other times map tiles are not shown at all being replaced with a message "Oops something went wrong".

 

Anyone has seen this behaviour? Any ideas why this is happening?

 

Thanks,

Bruno Santos

Staff
Posts: 251
Registered: ‎02-04-2016

Re: Google Maps in Geospatial Portal strange behaviour

Hi Bruno,

 

Sounds like an issue with Google Maps API key, do a F12 on the browser to see if you are seeing a "MissingKeyMapError".

 

See this link:

https://rubious.co.uk/2018/05/google-maps-api-changes-how-this-affects-you/

 

Hope this helps.

 

Regards,

 

Frank

Contributor
Posts: 60
Registered: ‎11-17-2015

Re: Google Maps in Geospatial Portal strange behaviour

Hi,

 

The behaviour of Google API "for developers only" became a little more agressive, with a message popup. We have generated a new key with credit card associated and the problem remains. We are seeing this only in version 2015 Portals. Is this version using Google API v2? And from 2016 onwards it is using Google API v3? I saw this could be a problem as API v2 is deprecated nowadays.

 

Regards,

Bruno Santos

Staff
Posts: 251
Registered: ‎02-04-2016

Re: Google Maps in Geospatial Portal strange behaviour

Hi Bruno,

 

If I remember correctly, Geospatial Portal v13 were using Google API v3 already.

 

Unfortunately, Geospatial Portal v15 has been out of support scope for a while...

 

Since the error is triggered by Google, you may need to get with Google for troubleshooting.

 

Regards,

 

Frank

Contributor
Posts: 60
Registered: ‎11-17-2015

Re: Google Maps in Geospatial Portal strange behaviour

Hi Frank,

 

I believe the problem is the way google api is loaded in v2015. This piece of code is not present in later versions:

        var other_params = "sensor=false";
        var lang = Sys.CultureInfo.CurrentCulture.name;
        if (lang) {
            if (lang.length > 2)
                lang = lang.substr(0, 2);
            other_params += "&language=" + lang;
        }
        google.load("maps", "3", {
            callback: callback,
            other_params: other_params
        });

Anyway I found a workaround adding the key parameter to other_params in v.2015 until we migrate projects to 2018+ versions.

 

Regards,

Bruno Santos

Staff
Posts: 251
Registered: ‎02-04-2016

Re: Google Maps in Geospatial Portal strange behaviour

Hi Bruno,

 

Good to hear that you are able to workaround the issue in 2015.

 

Did you re-compile the "Intergraph.WebSolutions.Core.WebClient.Platform.dll" with the new lines ?

 

Thanks

 

Frank

Contributor
Posts: 60
Registered: ‎11-17-2015

Re: Google Maps in Geospatial Portal strange behaviour

Hi Frank,

 

No recompile, faster solution (and testing) was to override the functions and put them in mapconfig.js.

 

Regards,

Bruno

Staff
Posts: 251
Registered: ‎02-04-2016

Re: Google Maps in Geospatial Portal strange behaviour

[ Edited ]

Hi Bruno,

 

We hava a HSI customer in the USA having similar issue with v15 SDK, if you could share the solution here, our regional HSI project manager will very much appreciate that Smiley Happy 

 

They are in the same boat as you as v15 is out of support (i.e. no more update/fix from DEV) therefore a custom solution (by the HSI project team) may be required to resolve the issue.

 

Thanks

 

Frank

Contributor
Posts: 60
Registered: ‎11-17-2015

Re: Google Maps in Geospatial Portal strange behaviour

Hi Frank,

 

Attached is the mapconfig.js I used. It overrides a standard function. You have to change the key to your customer value in line 58:

other_params += "&language=" + lang;other_params += "&key=<YOUR_API_KEY>";

 

It overrides 5 functions due to variables scope problems.

 

We are only maintaining this temporarily until migrate everything to more recent versions, where this problem does not occur. As usual, use it at your own risk…

 

Regards,

Bruno

Staff
Posts: 251
Registered: ‎02-04-2016

Re: Google Maps in Geospatial Portal strange behaviour

Hi Bruno,

 

Thank you very much !!!

 

Regards,

 

Frank

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.