Google My Maps - An infusion for PhpFusion

Introduction

Google My Maps is an infusion for the PhpFusion CMS.

It can render any KML file as a map.

Use it to display maps from Google's My Maps service within your PhpFusion powered website.
You can use any other valid source of KML - it should all work the same.

Use PhpFusion's access control system to control who has access to each of your maps.

The map fills the content area of a page and automatically sizes itself to the page width.
You can then select a height for each map from a list of presets.

Enable each map to have the default UI - this is the zoom and pan controls. It also enables mouse scroll wheel zooming.

Enable each map to have a sidebar of links to the map's locations.
The sidebar can be disabled or enabled, and displayed to the map's left or right.

Enable the Overview Map for each map, displaying a small overview map in the main map corner for faster navigation.

Select the map type that will be displayed when the map is first loaded. Options are; normal map, satellite map, hybrid map and terrain map.

Enable ClusterMarker for each map - ClusterMarker is a marker manager that replaces groups of intersecting markers with a single (cluster) marker.

Enable directions in a map's infowindow for each map, to get directions to and from locations.

Enable comments and/or ratings for each map.

Developed with PhpFusion version 7.
No version is currently available for version 6.

Installation

** Please remember to backup your database before installing this infusion **

The infusion archive file contains a folder named files which contains all of the files that you need to upload to your webspace.
This folder contains two subfolders: So upload the infusions and locale folders to your webspace - to the folder that contains your PhpFusion files.

Next (ensure that you are logged in to your PhpFusion website as admin) go to the Admin Panel, and then the System Admin panel.
Select the Infusions icon.

You should see Google My Maps in the drop down list of available infusions.
Select Google My Maps from the list and then Infuse.

The page should refresh and Google My Maps will appear as an infused infusion.

Google My Maps infusion is now installed.

Configuration

Return to the Admin Panel and select Infusions and you should see two admin panels for the infusion:

Google My Maps - API keys

Use of the Google Maps API is free but requires an API key - this is a unique key that you can obtain from code.google.com/apis/maps/signup.html.
If you're unsure what details (your domain) to enter to obtain an API key then read the FAQ where it is explained in more detail.

Assuming that you have successfully obtained an API key for your domain, go to the Google My Maps - API keys admin panel. The Server name form field should have automatically completed itself with your current domain.
So simply enter your API key in the API key form field and then enter your admin password - click Save API key and the key will be saved and used for any maps displayed on your domain.

The Google My Maps infusion when installed will install an API key for the localhost domain. This is a bogus API key - a valid API key is not required when displaying a map on the localhost domain so any string of 86 characters will work.
This localhost API key may be useful if you are running PhpFusion on localhost for development - otherwise feel free to delete it using the admin panel.

An API key is valid for a single domain - the domain on which the map is to be displayed. If your PhpFusion web site can be accessed by more than one domain then you will need an API key for each domain. The infusion will then use the API key that relates to the domain which has been used to access the map.

Google My Maps - KML

This is the admin panel where you configure your maps.

The Google My Maps infusion when installed will install 3 demo maps - you can edit or delete these as you wish.

To create a new map you need just a URL to a valid KML file.

You could create a map on Google's My Maps service, get a link to that map as a KML file and use that link in the infusion.

Or simply use any URL that points to a valid KML file.

Note that the default link provided by Google My Maps is not a link to a true KML file but what is known as a network link. This network link will not work with the infusion.
The solution is simple:
Original (network) link: http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&vps=1&jsv=196c&msa=0&output=nl&msid=111791480420984706339.00047bb1112f878e56292
Modified KML link: http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&vps=1&jsv=196c&msa=0&output=kml&msid=111791480420984706339.00047bb1112f878e56292

The link is now a valid link to a true KML file and will work with the infusion.

Complete the rest of the form.
It's all straightforward - some fields that might need an explanation are:

Uninstallation

To uninstall the infusion go to the Admin Panel and select System Admin panel and then the Infusions icon.
Click the Defuse link next to the entry for Google My Maps and the infusion will be uninstalled.

When uninstalled all API key entries and KML entries are removed from the database - they cannot be recovered after uninstalling.

Help and support

If you have problems installing or using this infusion or have any questions relating to it then please visit my Google Group where you can post any questions you have.

Martin Pearman.
2nd January 2009