Changes between Version 45 and Version 46 of GoogleMapMacro
- Timestamp:
- Apr 16, 2015, 11:47:13 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleMapMacro
v45 v46 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 = Insert a dynamic Google Map into wiki pages = 2 3 = Insert a dynamic Google Map into wiki pages 3 4 4 5 {{{ … … 8 9 }}} 9 10 10 == Description ==11 == Description 11 12 12 13 This macro lets the user insert a full dynamic [http://maps.google.com/ Google Map]. Because a lot of javascript is used (by Google) a [http://local.google.com/support/bin/answer.py?answer=16532&topic=1499 Google Map compatible browser] is needed. Newer version of Firefox and MS Internet Explorer are compatible. … … 23 24 The AdvParseArgsPlugin is used to allow for quoted argument values and must also be installed. 24 25 25 == Dependencies == 26 == Dependencies 27 26 28 The recent version ([4801]) of this macro needs the AdvParseArgsPlugin in revision [4795] or later. 27 29 28 == Bugs/Feature Requests ==30 == Bugs/Feature Requests 29 31 30 32 Existing bugs and feature requests for GoogleMapMacro are … … 34 36 [http://trac-hacks.org/newticket?component=GoogleMapMacro&owner=martin_s&release=0.11 new ticket]. 35 37 36 == Download == 38 [[TicketQuery(component=GoogleMapMacro&group=type,format=progress)]] 39 40 == !ToDo/Planned 41 42 * Implement some error handling for driving directions. 43 * Default values in config file for all arguments. 44 * Maybe merge source with GoogleStaticMapMacro to allow addresses there, too. 45 * Argument `static=yes` to render a static map while using GoogleMapMacro format. 46 47 == Download 37 48 38 49 Download the zipped source from [download:googlemapmacro here]. 39 50 40 == Source ==51 == Source 41 52 42 53 You can check out GoogleMapMacro from [http://trac-hacks.org/svn/googlemapmacro/0.11 here] using Subversion, or [source:googlemapmacro/0.11 browse the source] with Trac. 43 54 44 There is a develop version which can be unstable: [http://trac-hacks.org/svn/googlemapmacro/dev/0.11 check-out] | [source:googlemapmacro/dev/0.11 browse] 45 46 47 == Installation == 48 49 This macro is now provided as python package. 50 If you have installed an older single-file version of the macro please remove it from the `plugins` directory and note the different component name (see below). 55 There is a develop version which can be unstable: [http://trac-hacks.org/svn/googlemapmacro/dev/0.11 check-out]. 56 57 == Installation 58 59 This macro is now provided as a Python package. 60 If you have installed an older single-file version of the macro, please remove it from the `plugins` directory and note the different component name (see below). 51 61 52 62 == Configuration ==#config 53 63 54 A different [http://code.google.com/apis/maps/signup.html Google Map API key] is needed for every web domain which can be getfor free from Google.55 '''Please check if the Google Map API Terms of Use apply for your Trac project.''' They do apply IMHO for non-pay openaccessible Trac projects.56 57 To enable the macro put the below text into your `trac.ini` file, which is located in the `config` directory of your trac installation.58 You can define project wide default values for some arguments and also whether the geocoding (address-to-coordinates conversion) is done on by the trac server or by the clients web browser.64 A different [http://code.google.com/apis/maps/signup.html Google Map API key] is needed for every web domain which can be obtained for free from Google. 65 '''Please check if the Google Map API Terms of Use apply for your Trac project.''' They apply to free and openly accessible Trac projects. 66 67 To enable the macro put the below text into your `trac.ini` file, which is located in the `config` directory of your Trac installation. 68 You can define project wide default values for some arguments and also whether the geocoding (address-to-coordinates conversion) is done on by the Trac server or by the client's web browser. 59 69 Google recommends server side geocoding with caching which is now implemented and can be enabled using `geocoding = server`. 60 Please note that this creates a table `googlemapmacro` in your trac database which is used for the caching.70 Please note that this creates a table `googlemapmacro` in your Trac database which is used for the caching. 61 71 Server side geocoding is recommended but disabled by default. 62 72 63 You need to restart trac to reread the macro file and the configuration file. If you select server side geocoding you also need to update the Trac database using `trac-admin `''<trac path>''` upgrade`.64 65 {{{ 73 You need to restart Trac to reread the macro file and the configuration file. If you select server side geocoding you also need to update the Trac database using `trac-admin `''<trac path>''` upgrade`. 74 75 {{{#!ini 66 76 [components] 67 77 tracgooglemap.* = enabled … … 79 89 }}} 80 90 81 == Usage == 91 == Usage 92 82 93 The macro knows the following arguments, which can be used in the normal `key1=value1,key2=value2,...` syntax. If a value includes one or more comma then it must be set in double quotes (`" "`). 83 94 If a key-less value is given it will be taken as `center` coordinates if it's in the proper format otherwise it's taken as an `address`. Unknown (or misspelled) keys or key-less values except the first are silently ignored. … … 87 98 At the moment this isn't very accurate but soon [http://groups.google.com/group/Google-Maps-API/browse_thread/thread/53c4525e8d01e75d Google might improve] this. 88 99 `center`:: Sets the center of the map to the given coordinates. The format is `{latitude}:{longitude}` or `"{latitude},{longitude}"`. 89 `zoom`:: Sets zoom factor. Allowed values are between 0 (whole world) and 19 (single house). Very high zoom values might not be supported by Google Maps for all parts of the world.90 `size`:: The size either in the format `{width}x{height}` as numbers in pixel , e.g.: `300x400` means 300px wide and 400px high or100 `zoom`:: Sets zoom factor. Allowed values are between 0 (whole world) and 19 (single house). High zoom values might not be supported by Google Maps for all parts of the world. 101 `size`:: The size either in the format `{width}x{height}` as numbers in pixel: `300x400` means 300px wide and 400px high or 91 102 in the format `{width}{unit}:{height}{unit}` where unit can be any CSS unit (em, ex, px, in, cm, mm, pt, pc). 92 103 `types` (optional):: Sets the map types selectable by the user, separated by colons ('`:`'). If not given the standard types of Google Maps are used (Normal, Satellite, Hybrid). The following types are available (values are case-insensitive): … … 118 129 `from`,`to`:: Request driving directions '`from`'->'`to`'. Multiple `to` addresses are allowed. No `address` or `center` need to be given. 119 130 120 == Processor Syntax == 131 == Processor Syntax 132 121 133 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists it is getting messy for longer lists. 122 134 This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments. … … 135 147 }}} 136 148 137 == Examples == 138 139 === Using geographic coordinates === 140 Please use a colon, not a comma, as separator for the coordinates. 149 == Examples 150 151 === Using geographic coordinates 152 153 Please use a colon, not a comma, as separator for the coordinates: 141 154 {{{ 142 155 [[GoogleMap(center=50.0:10.0,zoom=10,size=400x400)]] … … 146 159 [[GoogleMap(50.0:10.0,zoom=10,size=400x400)]] 147 160 }}} 148 === Using an address === 149 Please use semicolons, not commas, as separators in the address. 161 162 === Using an address 163 164 Please use semicolons, not commas, as separators in the address: 150 165 {{{ 151 166 [[GoogleMap(address="Street, City, Country",zoom=10,size=400x400)]] … … 155 170 [[GoogleMap(Street; City; Country,zoom=10,size=400x400)]] 156 171 }}} 157 Please note that the address is converted into coordinates by user-side javascript every time the wiki page is loaded.158 If this fails no map will be shown, only an empty gray rectangle.172 Please note that the address is converted into coordinates by user-side Javascript every time the wiki page is loaded. 173 If this fails, then no map will be shown, only an empty gray rectangle. 159 174 160 175 Server side address conversion including caching is underway. 161 176 162 === Using both === 177 === Using both geographic coordinates and addresses 178 163 179 If both address and center coordinates are given, then the result depends on the [#config `geocoding` setting]: 164 180 `server`:: The address is resolved on the trac server and the coordinates are completely ignored. … … 169 185 }}} 170 186 171 172 === Select Map Types === 187 === Select Map Types 188 173 189 To show a map with the standard map types where the satellite map is preselected: 174 190 {{{ … … 193 209 }}} 194 210 195 === Markers === 211 === Markers 212 196 213 To create three markers: one at the center of the map (A), one at the next street (B) and one at coordinates 10.243,23.343 (C): 197 214 {{{ … … 203 220 }}} 204 221 205 == Recent Changes in the Release Branch ==222 == Recent Changes 206 223 207 224 [[ChangeLog(googlemapmacro/0.11, 3)]] 208 225 209 == Author/Contributors ==226 == Author/Contributors 210 227 211 228 '''Author:''' [wiki:martin_s] [[BR]] 212 '''Maintainer:''' [ wiki:martin_s] [[BR]]229 '''Maintainer:''' [[Maintainer]] [[BR]] 213 230 '''Contributors:''' 214 215 == !ToDo/Planned ==216 * Implement some error handling for driving directions.217 * Default values in config file for all arguments.218 * Maybe merge source with GoogleStaticMapMacro to allow addresses there, too.219 * Argument `static=yes` to render a static map while using GoogleMapMacro format.