dev-util/idea-* minor fixes
[anomen-overlay.git] / www-apps / pmwiki / cookbook / Geobox / readme.txt
blob782b7432729fa47255c1286a0f9c7501c70fc75d
1 >>recipeinfo<<
2 Summary: Create links to various map sites from provided gps coordinates.
3 Version: 2012-09-07
4 Prerequisites: 
5 Status: 
6 Maintainer: [[~Anomen]]
7 Users: {{$FullName}-Users$Rating2} ([[{$FullName}-Users|View]] / [[{$FullName}-Users?action=edit|Edit]])
8 Categories: [[Links]]
9 Discussion: [[{$Name}-Talk]]
10 >><<
11 !! Questions answered by this recipe
12 How to automatically create links for given gps coordinates to various map sites.
14 [[#desc]]
15 !! Description
16 Recipe creates links to various map sites from provided gps coordinates.
18 [[#install]]
19 !!Installation
20 Download [[(Attach:)geobox.php]].
22 In config.php, add the following line:
25  include_once("$FarmD/cookbook/geobox.php");
28 [[#usage]]
29 !!Usage
30 Use geobox markup 
31 [@ (:geo 49°43.996 14°27.665 :) @]
33 to create link list:
34  ''49°43.996' 014°27.665'' [[http://www.mapy.cz/?query=49.73327N%2014.46108E | mapy.cz]] [[http://maps.google.com/?q=49.73327%2014.46108|gmaps]] [[http://www.geocaching.com/map/default.aspx?lat=49.73327&lng=14.46108|geocaching.com/maps]] [[http://www.geocaching.com/seek/nearest.aspx?lat=49.73327&lng=14.46108&f=1|geocaching.com/near]]
36 !!! Coordinate input format
37 *Coordinates consists of latitude and logitude values separated by space character(s).
38 * Values can pre prefixed or postfixed with N or S for lat. and E or W for lon.
39 * Decimal dot or coma can be used.
40 * several different characters can be used as degree sign ( * ° ˚ º ). This simpifies usage across various keyboard layouts. Note: PmWiki must be setup to use Unicode.
41 * all three formats are recognised (degrees only and mixed formats with arcmin or arcmin+arcsec)
42 * degree sign is mandatory only for mixed formats (to separate degrees and arcminutess)
44 !!!Coordinate display format
45 You can change format of displayed coordinates by using ''format'' paremater.
47 Possible values and meanings are:
48 : D : deg°
49 : M : deg°min'
50 : S : deg°min'sec"
52 For example, following line will produce coordinates displayed as degrees:
53 [@ (:geo format=d 49°43.996 14°27.665 :) @]
55 !!!Point projection
56 You can perform point projection using parameters ''azimuth'' (value in degrees) and ''distance'' (value in meters).
57 Result of projection will be displayed (together with proper links) instead of original given coordinates.
59 For example, following line will produce coordinates @@ 50.00949 15.18703 @@:
61 [@ (:geo format=d azimuth=45 distance=2703 49.99232 15.16031 :) @]
64 [[#config]]
65 !!Configuration
67 !!!Map sites
68 You can modify list of links by changing @@$GeoBoxLinks@@ array.
70 : disable list :  @@$GeoBoxLinks = array();@@
71 : remove link : @@unset($GeoBoxLinks['mapy.cz']);@@
72 : add link :  @@SDVA($GeoBoxLinks,  array('title'=>'http://example.com/maps'));@@
73 : replace list:  @@$GeoBoxLinks = array('title'=>'http://example.com/maps');@@
75 In link address you can use these variables (prefixed by @@$@@ sign):
76 : LAT : hemisphere N / S
77 : N  : latitude
78 : S : -latitude
79 : Nd : latitude (absolute value)
80 : Ni : latitude (integer part only)
81 : Ndi : latitude (absolute value, integer part only)
82 : NSig : sign for N (empty for north, - for south)
83 : Nm : minutes of N (absolute value)
84 : Nmi : minutes of N (absolute value, integer part only)
85 : Ns : : seconds of N (absolute value)
86 : Nsi : seconds of N (absolute value, integer part only)
88 : LON : hemisphere E / W
89 : E : longitude - ''all values analogical to latitude''
90 : W :
91 : Ed :
92 : Ei :
93 : Edi :
94 : ESig :
95 : Em :
96 : Emi :
97 : Es :
98 : Esi :
100 -> Note: Either apostrophes must be used as string delimiters instead of double quotes or proper @@$@@ escaping must be used to avoid expanding of variables by PHP.
102 !!!Example
103 * print coordinates and link to google maps
106  include_once("$FarmD/cookbook/geobox.php");
107  $GeoBoxLinks = array('maps.google.com'=>'http://maps.google.com/?q=$N%20$E');
110 * add link to mapquest.com
113  include_once("$FarmD/cookbook/geobox.php");
114  SDVA($GeoBoxLinks,  array('mapquest'=>'http://www.mapquest.com/?q=$N,$E&amp;zoom=15'));
118 [[#relnotes]]
119 !! Change log / Release notes
120 * 2010-06-12 - added to PmWiki Cookbook
121 * 2011-08-22 - point projection, configurable link list and various improvements
122 * 2011-10-05 - utf8 handling, various fixes
124 [[#seealso]]
125 !! See also
126 : git repository : http://repo.or.cz/w/anomen-overlay.git/tree/HEAD:/www-apps/pmwiki/cookbook/Geobox
128 !!!Links
129 * http://transition.fcc.gov/mb/audio/bickel/sprong.html
130 * http://www.movable-type.co.uk/scripts/latlong.html
131 * [[http://handygeocaching.googlecode.com/svn/trunk/src/gps/Gps.java  | Handy Geocaching sources]]
133 [[#contributors]]
134 !! Contributors
135 * [[~Anomen]] (original author)
136   
137 [[#comments]]
138 !! Comments
139 See discussion at [[{$Name}-Talk]].