History: Geolocation
Source of version: 17 (current)
Copy to clipboard
{syntax type="markdown" editor="wysiwyg"} # Geolocation Starting at ((Tiki9|version 9)), tiki allows the geolocation of wiki pages, blog posts, articles and tracker items, using OpenStreetMaps. Since ((Tiki20|version 20.1)) new tile providers can be used, and clustering of mapped features is possible. {img src="display707" url="display707" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} ## Admin panel **Options shown in Settings section** - Available tile layers on maps: - Valid options are: openstreetmap, openaerialmap, google_street, google_satellite, google_physical, google_hybrid, blank - Google Street View - Google Street View Overlay - Geolocate blog posts - Geolocate wiki pages - Geolocate articles - Plugin Map - Location - Always load OpenLayers - Google Maps API Key **Options shown in MapServer settings** - MapServer ##$ Requirements In order to have this feature properly working, you are encouraged to enable the following: For tiki versions older than 14.0: - **Admin home > Textarea > Plugins > Plugin Map** (to enable the plugin to show the map with geolocated data) - **Admin home > Textarea > Plugins > Plugin List** (to select some subset of objects to be displayed in the map, instead of all) - **Admin home > Maps > Always load OpenLayers** enabled (for the "**search location** feature to work). For ((Tiki14|tiki 14.0)) and newer: - **Quick Administration > Control Panels > Plugin Map** - **Quick Administration > Control Panels > Always load OpenLayers** (Make sure that the *Preference Filter* is set to **advanced** and/or **experimental**) ##$ Geolocate wiki pages Enable the feature in **Admin home > Wiki > Features > Geolocation of wiki pages** And ensure that you have the option **Admin home > Maps > Always load OpenLayers** enabled for the "**search location** feature to work. Then edit some Wiki pages (1), go to the properties tab (2), and place a marker for the position in the map you want to set for each page. You can click at "Search location" (3), add some address (4) and click at OK (5): {img src="display708" url="display708" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Once the location is found (without page reload), the map will be updated with the new location in the middle. You can save the page to keep the new location associated with the wiki page: {img src="display709" url="display709" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} If you want that wiki page to show a map with that geolocation shown, add a call to the plugin map in the page: {CODE()} {map} {CODE} If you want to display all wiki pages that contain geolocation data, and with a different marker from the one shown for the wiki page where the map is shown, you can place this code inside the wiki page: {CODE()} {map} {LIST()} {filter type="wiki page"} {filter content="y" field=geo_located} {LIST} {CODE} The wiki page will show this type of map: {img src="display710" url="display710" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} In case you want to show only the item corresponding to this wiki page, you can use this code instead: {CODE()} {map} {LIST()} {filter type="wiki page"} {filter content="{{page}}" field=object_id} {filter content="y" field=geo_located} {LIST} {CODE} In some case you may have some items with a map location set and some items without. Those without will display a map and you may prefer this not to happen. You can hide the field using a Javascript plugin and some code on the page: {CODE(caption="hide location field when location is not set")}{JQ()} var map = $('input[name="location"]').val(); if (map == "0,0,2") { $('#openlayers1').hide(); } {JQ}{CODE} For more options to filter which content to be shown in the map, see ((PluginList)) ##$ Geolocate blog posts or articles You must enable the setting in "Admin home > Maps", and this will show a new field in the blog or article edit screen in which you will be able to indicate the position associated with that publication. Later on, you can display a map displaying only those geolocated items, or in conjunction with other geolocated items in your site. See profile "((pr:Easy GeoBlog))" as a working example. ##$ Geolocate tracker items Simple example: {CODE()} {MAP(scope="center" controls="controls,search_location,scale,navigation" width="800" height="400" center="2.1421963549255145,41.381029526482095,7")} {searchlayer geo_located="y" maxRecords=100 tracker_id="1" type="trackeritem"} {MAP} {CODE} See some more advanced examples in the page ((PluginMap)) Related: - ((Maps)) - ((pr:GeoCMS_Maps_18)) {DIV(class=titlebar)}Alias names for this page{DIV} (alias(Geolocation of wiki pages)) | (alias(Geolocalization)) | (alias(Geolocate)) | (alias(GIS))