A number of people has been asking about documentation for the Google Map Asset. There has been no official manual yet, so I'm writing a quick guide for people who are interested in setting up a Google Map in MySource Matrix
Setting up Google Map Asset
- Sign up for Google Map API key at http://code.google.com/apis/maps/signup.html
- Create a Google Map asset in Matrix
- Acquire Lock(s) on the Google Map asset from Details screen
- Copy the registered Google Map API and paste into the "API Key" text box on the Details Screen
- Commit the change
- Go to the "Default Setting" section on the Details Screen
- Click on the blue globe icon, a mini map will appear to allow setting of map center and zoom level. User can click directly on the map and the values in the latitude, longitude, zoom level text boxes will change.
Since the Google Map asset work similarly to Asset Listing in MySource Matrix, Page Contents bodycopy and Page Contents No Result bodycopy are used.
"Page Contents" bodycopy is used when there are locations being listed by Google Map Asset
"Page Contents No Results" bodycopy is used when there are no listing configured for Google Map Asset
Displaying a blank map:
- After completing the above steps, "Page Contents No Results" bodycopy will be used to print the frontend as listing has not been configured.
- To display just a blank map, copy the keywords in "Page Contents" bodycopy to "Page Contents No Results" bodycopy
i.e.:
- Save the changes for "Page Contents No Results" bodycopy.
- Preview the asset, the map will be displayed. The height and width of the map can be changed in the "Map Initialisation" attribute on the Details Screen of the Google Map Asset
Configure Location Listing By Latitude and Longitude
1. Create a folder name "Locations"
2. Create a number Google Map Location asset in there. Make sure to fill each of them with Name, Latitude, Longitude, Description information.
3. Go to the Listing Options Screen of the Google Map asset.
4. Acquire the locks, Add a new Asset Types to List of type "Google Map Location". Also select the appropriate status(es) to list.
5. Select the "Locations" as the Root Nodes to list locations from.
6. Preview the asset, the map will be displayed with all the created locations plotted on the map.
Note that since there are locations to be listed, "Page Contents" bodycopy is used to display the map. Any HTML or JavaScript changes should be made to the "Page Contents" bodycopy instead of "Page Contents No Results" bodycopy.
7. Clicking on each location on the map will bring up a Popup with the description of each location. This popup layout can be changed from the "Popup Window" bodycopy of the Google Map Asset
8. An Image can be used as icon for a particular location on the map. The "IconURL" attribute for each of the location can be changed to allow custom con to be displayed on the map instead of the default pink / orange icon of Google.
Configure Location Listing By Address
1. Create a folder name "Locations By Address"
2. Create a metadata schema name "Location Information"
3. Create a section for the metadata schema
4. Create 3 text fields in the section with the following names: "Address", "Description", "IconURL"
5. Apply the metadata schema on the "Location By Address" folder
6. Create "Data Record" assets in this folder, each of them will represent a location.
7. Edit the metadata for each of this location and put in Address, Description at least.
8. Go to "Listing Options" screen of the Google Map asset
9. Add a new Asset Types to List of type "Data Record". Also select the appropriate status(es) to list.
10. Select the "Locations By Address" as the Root Nodes to list locations from.
11. A number of text boxes will appear after the change is committed. Leave the "Latitude" and "Longitude" keyword text boxes blank. Fill in
Address Keyword with "% asset_metadata_Address %",
Description Keyword with "% asset_metadata_Description %"
Icon URL Keyword with "% asset_metadata_IconURL %" (If custom icons are used for each location)
12. Go to the Details Screen of the Google Map asset
13. Acquire Locks and set "Enable Geocoding Service" to "Yes".
14. Preview the asset, the Google Map asset will send a query to retrieve latitude and longitude information for each of the location, and cache this information. The first load might take a while, but the next time the map is view it will load faster as all the address latitude and longitude has been found and cached earlier.
Loading KML file. Refer to this topic on the MySource Matrix Forum
http://code.google.com/apis/maps/signup.html