I thought the "echo str_replace" part may have also changed. I still have some other issues in order to make this work which I am trying to sort out.
However, while testing I got a notice from Google informing me that on June 16, 2018 they will start charging for using the Google Map API. Do you know anything about this and how it may affect the Google Map app?
More info: https://cloud.google.com/maps-platform/