IP Mapping and Google Maps
We have recently been notified of a problem where the Maps generated by our IP Mapping using the Google Maps API were never completing.
Viewing the Java console log we could see that there were reported problems as follows:
However in looking further we discovered a few further interesting aspects of the use of the Maps API which are worthy of mentioning.
The first is that in line with many cloud computing providers, the Google Maps API moved to a pay-as-you-go pricing structure on 11th June 2018.
The newly-named Google Maps Platform was brought under the Google Cloud umbrella and consists of three core products: Maps (for delivering customised dynamic maps, Street Views and 360° views), Routes (directions and traffic) and Places (location names, addresses, reviews etc). Each has its own pricing structure.
More importantly the new pricing strategy employed by Google for their Maps Platform is a freemium one – all users get to make $200-worth of API calls for free each month. Thjs means that one has to use an API Key and register a billing account, even if you never are going to pay. Even if your usage falls well within the free $200 credit, you still have to create an account and provide Google with billing details to keep using the APIs. It should be possible to set up a usage cap, but we have been unable to do this yet, until the 'free' time expires.
It is also important to add some restriction on the API key to secure it. We found this web page How to Fix “This page didn’t load Google Maps correctly” Error.
This proved very useful in setting up an API Key, although we did encounter some problems setting up the HTTP referrers, in getting them to 'take'.
The fix involved us modifying the code in two php files located in the Jooma/modules/mod_ipmapping_mapper directory. These files named 'mod_ipmapping_mapper.php' and 'minify_js.php', were modified to change the internal http prefix to https and this resolved the coding problem. The latter file is probably the more important to change. The official fix will be included in the next schedued release.