Loading...
 
Skip to main content

History: Mod gmap

Source of version: 20 (current)

Copy to clipboard
            ^This page ((needs review))^
{include page="Maps General information"}


^ See ((PluginGoogleMap)), which is bundled in Tiki5 ^

^__Information on this page is outdated starting from Tiki5. The mod below is no longer supported as it has been replaced by ((PluginGoogleMap)) which is bundled in Tiki 5__^

!!Mod Gmap
This is a ((Wiki plugin)), distributed as a ((mod)) for displaying a ((Gmap)) in a wiki page, where each page represents a marker on a global map. The mod creates a geo-coded location of a wiki page, backlinked pages, or pages in a structure. It is currently available only as a ((mod)), which means you have to upload the files to replace the current gmap plugin.

__Author:__			Nelson Ko
__License:__		        LGPL
__Last Version:__	      1.0 ( 2007-06-30)
__Download:__                [http://mods.tiki.org/details.php?type=wikiplugins&mod=gmap|mods.tiki.org] or use mods in your tikiwiki to install.
^__Note:__ be sure to turn on feature googlemaps and get them working first including the google activation code.^

^__Plugin Syntax:__
~np~  {GMAP(type=>page, width=>400, controller=>none, mode=>normal)/}~/np~
*optional parameters are separated by commas 
*there are no spaces anywhere, except after commas.^


!!Parameters

||__Parameter__|__Accepted values__|__Description__|__Default__

type|page|maps the current single page|page 
 |backlinks|maps the backlinks of the current page
 |structure|maps the pages in the structure that the current page is in
 |route|maps the pages in the structure that the current page is in and draws a line between points as in a route

width|number |width in pixels|500

height|number |height in pixels|400

controller|large|this contains pan/zoom buttons and clickable zoom scale| large
 |medium|this contains pan/zoom buttons but no clickable zoom scale
 |small|this contains zoom buttons only
 |none|the controller is disabled

changetype|y/n|the buttons to change the mode of the map can be disabled|y

scale|y/n|the display of the map scale can be disabled|y

mode|normal|start the map in normal streetmap mode|normal
 |satellite|start the map in satellite mode
 |hybrid|start the map in satellite/streetmap hybrid mode||

__Notes:__ 
* To use this plugin, you should set the cache time for wiki pages = 0 (no caching), otherwise you may have dificulties editing geolocations (or seeing the edits you have made anyway). Set the wiki cache in Admin>Wiki
*Having multiple google maps on the same page is not recommended as it can cause unpredictable results.

!!! Using this Plugin


__Type=Page__
The default syntax (above), when saved in a wiki page will produce the following map. 

{img src="img/wiki_up/2007-08-08_113812.png" }

__At this point you can:__
*click on the + sign to open the location editor.
*type in an address and "GO" to that address.
*single click on the map directly to create a point on the current map. 

__Using the Location Editor__

{img src="img/wiki_up/2007-08-08_114917.png" }
Once you have created a point on the map, you can edit the information that appears in the balloon. The latitude and longitude information is normally not editable. You change the location by clicking on the map or by searching to a new address.


-=Related pages=-
* ((Wiki Plugin))
* ((Mods Type Wikiplugins))




{CODE()}
Requirements and additional instructions:

This pluging may be added via the mods admin panel at yourdomain.com/tiki-mods.php
These steps below should be taken care off through the mods deployment process. Otherwise the manual steps required are:

1. This file is to be deployed to <tikiroot>/lib/wiki-plugins/

2. Included gmapwikipluginlib.php should be deployed to <tikiroot>/lib/wiki-plugins/

3. Included gmap_wikiplugin_save.php should be deployed to <tikiroot>/

4. The following included smarty templates should be deployed to <tikiroot>/templates/wiki-plugins/
wikiplugin-backlinkgmap.tpl
wikiplugin-gmap.tpl
wikiplugin-routegmap.tpl
wikiplugin-structuregmap.tpl

5. The following SQL command is to be executed to create the necessary database table:

CREATE TABLE `wikiplugin_gmap` (
	`pageid` int(14) NOT NULL,
	`pref` varchar(40) NOT NULL,
	`value` varchar(250) default NULL,
	PRIMARY KEY  (`pageid`,`pref`)
) TYPE=MyISAM;

6. In order for route type to work and for the google maps polylines to work, the VML namespace
must be specified in the html tag in <tikiroot>/templates/header.tpl, like this:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">


7. When using the plugin, click on the "+" icon next to the text at the top to access the geocoding information.
The coordinates are automatically into the fields there through mouse clicks on the map.

8. Note that having multiple google maps on the same page is not recommended as it can cause unpredictable results.

{CODE}