How to

Google Maps API

Google Maps API

MapTiler automatically generates a Google Maps viewer for rendered tiles. It is simple HTML text file which contains Google Maps JavaScript API code with parameters from your rendering. This file is prepared for direct upload to any hosting as a fullscreen app or it can be modified or embeded to your needs. Here is an example:

Add your API key

Latest Google Maps API’s requires personal API key for each published app. You have to generate your api key and use it in the template to get your Google Maps templates working. More information is available at Google Maps API pages and you can get your key in Google Developers Console. If you don’t have your key set you can se error message like that:

Google Maps Error

This message can also appear in older versions of MapTiler as they also use Google Maps API for viewing maps. In such cases upgrade your MapTiler to the latest version from Download section.

Using key

The key is used when pasting Google Maps Javascript Library into a page header as a parameter to query:

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
  async defer>
</script>

Set your key in MapTiler

From MapTiler 7.0 on we added a field for this key to MapTiler’s settings. MapTiler will automatically add this key to pre-generated templates with Google Maps API to save your time and effort.

MapTiler settings