Topic: Configuring Google Maps in Kete
Topic type:
In Kete, sites have the ability to include Google Maps within items extended fields. Here is how you set it up.
- enable Google Maps use site wide
- create an Extended Field that stores a map value
- add that Extended Field to a Content Type (images, documents, etc.) or Topic Type (Place, Organization, etc.)
Google Maps Usage Conditions
Be aware that Google Maps use has usage limits for free use of 25,000 map loads per day (and it has to be for 90 concecutive days). According to this blog post by Google, only .35% of sites are ineligible for free use so you are probably fine.
Enabling Maps in Kete 1.3 and later
As a site administrator with tech administrator privileges, do the following.
- Scroll to the bottom of any page and find the Administrator's Toolbox
- Click reconfigure site
- Click System
- Set Enable Maps to true, read the information for it THOROUGHLY!
- (optional) set Default Latitude and Default Longitude to where you would maps to be centered on for new location fields. Make sure to use valid coordinates in the proper format! You can come back and update this later, too.
- Fill out the setting accordingly and click Save
- Click Restart Server
Browse by Map
In Kete 1.3 and later, you can view search results as pin points on a map, which when clicked, pop up a bubble contain the items information (title, description etc). To activate this feature, when you create a google map extended field, and simply you set it's xml element name to dc:coverage, and Kete does the rest.
A more detailed example of this is covered in http://old.kete.net.nz/documentation/topics/show/267-how-can-i-configure-support-for-extracting-geotags-from-uploaded-images-in-kete.
Note: The above extended field creation will only apply if you haven't set it up yet. If you have setup google maps before, but without the xml element name, you can add it by editing the map extended field, but you must rebuild zebra to make these changes take effect.
Enabling Maps in Kete 1.2
- Go and sign up for a Google API Key. It's free (for non-commercial sites, commercial sites must pay license fee) and simple. Go to http://code.google.com/apis/maps/signup.html and put the URL of the website that'll have the Google Maps. Agree to the terms and sign up, then copy the key you get on the next page.
- Copy config/google_map_api.yml.example to config/google_map_api.yml , open it and replace the Key there with the one you got when you signed up in step 1, and save the file.
Creating an Extended Field that has a map value
- Login to your Kete site as an site administrator, click the "extended fields" link in the Administrators Toolbox.
- Create a new extended field there selecting one of the following for ftype:
- Location on map (lat/lng coordinates)
This will just display a map on the item show pages pin pointing the location selected when adding/editing the item - Location on map with address
This will display a map like the previous option but will also display the address of the location pinpointed above the map.
- Location on map (lat/lng coordinates)
Add Extended Field to a Content Type or Topic Type
Once you have an extended field (e.g. Location) that has an ftype of Location on Map or Location on map with address, you can then add to either a topic type or a content type to have the form and display of items of that type provide a map.
- As a site administrator, click on either the content types or the topic types link in the Administrator's Toolbox
- In the list of topic types or content types, click Edit next to the type you want to add the field to
- Under Availalable Form Fields, check the box (optional or required) that is appropriate for your new field and submit the form by clicking the button
- Your map field will now show up as a map widget in the form for adding or editing items of that type and once map data has been entered, a map with the location represented as a "pin" will show up on the display page for items with map data.
You can have multiple maps on each item (for topics like "5 Best Cafe's in Wellington", each with their own pinpointed location). They must be individual extended fields though. Just add more extended fields and assign them to that topic/content type.
When browsing or searching, results with map data will now be available to "view on map", as well.