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.
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
Usage
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. See http://kete.net.nz/documentation/topics/show/267-how-can-i-configure-support-for-extracting-geotags-from-uploaded-images-in-kete for details.
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.
- Go to you Kete setup (assumes you've pre configured this site), and when logged in as an admin, click the "extended fields" link in the Administrators Toolbox. Create a new extended field there selecting one of the following:
- 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 that Extended Field to a topic or other content type.
- The google map will now be present when someone creates an item of the type that map is associated with.
You can have multiple maps on each item (for topics like "5 Best Cafe's in Wellington", each with their own pinpointed location). Just add more extended fields and assign them to that topic/content type.
By default, the Google Map will zoom (to the country level) on the ISP the user is access the internet from (it's the closest we can get at the moment). When the location cannot be retrieved, it uses a set of default coords and zoom level, found in the google_map_api.yml configuration file. If you want to change these, you can get the coords of the desired default location by creating an item as described above, saving it, and copying them from the items show page into their respective fields in the configuration file. For the zoom level, it starts at 1 (from the most zoomed out level) and increases by one every time you press the + button on the Google Map.

