I was once creating a contact page in Adobe InDesign, wondering 'wouldn't it be great if there was a way to add a Google map?'
Well, there is, and in this tutorial I am going to show you how to embed it into an InDesign project.
In this lesson, we'll focus how to use the Insert HTML feature, add custom Google map sizes and set up an interactive experience so viewers can navigate through multiple maps with button interactivity.
You can find the files for this tutorial, including the InDesign document, available for download here.
The first step before jumping into InDesign is setting up the custom sizes on Google maps. In this tutorial, we'll create general maps for Los Angeles, Toronto and New York to correspond with the marker icons for this fictional logistics company called Sprightly.
Creating Custom Map Size
Open the web browser of your choice and go to https://www.google.com/maps.
Since Los Angeles will be the first map marker in the menu, type in Los Angeles in the Google maps search bar.
Click the Share button, which will launch the Share window to Copy the link.
Click the Embed option.
As a default, the size will be set to Medium, however you can choose from Small, Medium, Large and Custom. Click Custom.
Set the width to 768 px and the height to 244 px. Click Preview Action Size to see the map size in real time.
Click the Copy HTML button to copy the embed code.
Awesome! You created the first map. Now let's go back to InDesign and see it in Action. In the document provided in this tutorial, you will notice empty space that is open to place the maps.
Embedding Google Map to InDesign
Go to Object > Insert HTML.
Paste the HTML code from the Google map that you created and click OK.
It may take a few seconds to appear. If you only see the message "This is an HTML snippet", right-click it and choose Edit HTML. Paste the code again and click OK.
The map will appear in an empty frame but it will be the size that was set when creating it. Position the map in the space allotted.
The map will be invisible on the page itself. That is because it is not an image, rather HTML content within a frame. To ensure it is in fact working as intended, go ahead and open any of the Interactive panels and click the EPub Preview icon to see the map in real time.
In the Layers panel, rename the map, which will be called HTML code, to Los Angeles Map. You will have to create the custom map sizes for Toronto and New York and follow the same steps as explained above.
Once you have all three maps on the page, ensure that they are in the same order as the map marker icons – Los Angeles Map, Toronto Map and New York Map.
For this next part, you will need to open the Object States panel. You can access this by going to Window > Interactive > Object States.
Select all three HTML maps on the page and in the Object States panel, convert the selection to a Multi-State Object.
Rename the Object Name to Google Maps.
Click on State 1 once and change the name to Los Angeles Map.
Click on State 2 once and change the name to Toronto Map
Click on State 3 once and change the name to New York Map.
Click on the first map marker icon over the Los Angeles information and in the Buttons and Forms pane, convert the object to a button.
Name the button Los Angeles Map Button.
Click the Actions plus icon to add an Action of Go to State.
The Object will be set to Google Maps, but set the State to Los Angeles Map.
Repeat the same steps for the Toronto and New York marker buttons, renaming the buttons and setting the Actions to correspond with the respective HTML maps.
Watch the video tutorial as I also go over how to add rollover and click appearance effects to the button markers, so when the project is viewed on mobile or an iPad, the buttons will also be interactive.
This can be exported as ePub (Fixed Layout) and be viewed in an e-reader or published online using InDesign's handy Publish Online share button.
I'll go over those steps in the video tutorial too.