User Tools

Site Tools


en:user:map_view
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Last revision
en:user:map_view [2017/07/11 22:39] – created kjdon
Line 1: Line 1:
 +====== Enabling a map view ======
 +
 +In greenstone 3, if your documents or images have GPS metadata then you can add in a Google maps feature which will plot the documents on the map.
 +
 +Please see the [[http://files.greenstone.org/tutorial/gs3-current/en/images_gps.htm|Image Collection with GPS metadata]] tutorial for details.
 +
 +There are a few configuration settings missing from the tutorial (as at July 2017). Here is a summary of steps to follow:
 +
 +  * Add GPS metadata manually to documents, or use EmbeddedMetadataPlugin to extract it automatically from images.
 +  * Add indexes on ex.Latitude, ex.Longitude, ex.LatShort, and ex.LngShort
 +  * Add <code><gsf:option name="mapEnabled" value="true" /></code> to the format statements for **search**, **browse** and **display**.
 +  * Add **raw** to the list for the searchTypes format feature.
 +  * Rebuild the collection.
 +
 +Older versions of Greenstone 3 may have an out-of-date code for accessing the google maps api. Check the file web/interfaces/default/transform/layouts/header.xsl, and look for <code><script src="http://maps.googleapis.com/maps/api/js?</code>
 +
 +If it looks like
 +<code>
 +<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"><xsl:text> </xsl:text></script>
 +</code>
 +
 +then change it to 
 +<code>
 +<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCofVTps3xHfMvIcTMHqYMMxe3xXfkAxnI" type="text/javascript"><xsl:text> </xsl:text></script></code>
 +
 +Note this uses a key owned by the Greenstone project. There is a limit to how many requests any one key can have per day, so it may pay to set up your own key, see [[https://developers.google.com/maps/documentation/javascript/get-api-key]].
 +
  
en/user/map_view.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1