Changes between Version 24 and Version 25 of GoogleStaticMapMacro
- Timestamp:
- Jan 17, 2016, 2:24:29 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleStaticMapMacro
v24 v25 12 12 Please note that the maximum size supported by Google is 640x640 pixels. If a bigger width or height is requested, it will be reduced to 640px. 13 13 14 The macro should work both with Trac 0.11 and 0.12. At the moment there is only a 0.11 directory which can also be used for Trac 0.12.14 The macro should work both with Trac 0.11 and 0.12. At the moment there is only a 0.11 directory, which can also be used for Trac 0.12. 15 15 The AdvParseArgsPlugin is used to allow for quoted argument values and must also be installed. 16 16 … … 60 60 The older syntax can still be used with newer versions of the macro by setting `api=1` either as a macro argument (`[[GoogleStaticMap(api=1,<old syntax>)]]`) or using the global [#config configuration] option `default_api_version`. 61 61 62 Please note, that since v2 an API key is no t required anymoreby Google. The API v1 still requires a Trac server specific Google Map API key which is [https://developers.google.com/maps/signup?csw=1&safe=on provided by Google for free].62 Please note, that since v2 an API key is no longer required by Google. The API v1 still requires a Trac server specific Google Map API key which is [https://developers.google.com/maps/signup?csw=1&safe=on provided by Google for free]. 63 63 64 == Usage &Examples64 == Usage and Examples 65 65 66 This documentation describes the syntax for the macro v1.x which uses Google's API v2 (see [#Upgrade]). The older syntax is still supported using the `api=1` argument. See [./ GoogleStaticMapMacro?version=18 an older version] of this wiki page for the old syntax. Mixing of older and newer syntax is not supported.66 This documentation describes the syntax for the macro v1.x which uses Google's API v2 (see [#Upgrade]). The older syntax is still supported using the `api=1` argument. See [./@18 an older version] of this wiki page for the old syntax. Mixing of older and newer syntax is not supported. 67 67 68 68 === Parameters … … 70 70 The macro accepts the official [https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on Google Static Map argument] as well as a few internal arguments: 71 71 title:: Sets the HTML title of the map image. 72 api:: Sets the API version to be used. By default set to "`2`". To reuse the older macros, set `api=1` as mentioned earlier.72 api:: Sets the API version to be used. By default set to `2`. To reuse the older macros, set `api=1` as mentioned earlier. 73 73 key:: Sets the API key if not set globally in the config file. Deprecated for macro v1.x / Google API v2. 74 74 75 All map locations (center, markers, path) can now be given as address or geographic coordinates (latitude,longitude). Please note that addresses and coordinates __must__ be quoted using double-quotes (`"`) when they include a comma. This is always the case with coordinates. The old macro syntax used colons (`:`) as substitutes, which no longer supported in the new syntax.75 All map locations (center, markers, path) can now be given as address or geographic coordinates (latitude,longitude). Please note that addresses and coordinates __must__ be quoted using double-quotes (`"`) when they include a comma. This is always the case with coordinates. The old macro syntax used colons (`:`) as substitutes, which is no longer supported in the new syntax. 76 76 77 77 For example: 78 78 {{{ 79 [[GoogleStaticMap(center="50.805935,10.349121", zoom=5,size=400x400)]]80 [[GoogleStaticMap(center="Germany", zoom=5,size=400x400)]]79 [[GoogleStaticMap(center="50.805935,10.349121", zoom=5, size=400x400)]] 80 [[GoogleStaticMap(center="Germany", zoom=5, size=400x400)]] 81 81 }}} 82 82 83 83 will both result in the following map image: 84 84 85 [[Image(http://maps.google.com/staticmap?center=50.805935%2C10.349121&zoom=5&size=400x400, nolink)]]85 [[Image(http://maps.google.com/staticmap?center=50.805935%2C10.349121&zoom=5&size=400x400, nolink)]] 86 86 87 87 === Markers 88 88 89 You can add markers to the static map using the '`markers`' argument. The format is '`markers=style settings|first location|next location|...`'89 You can add markers to the static map using the `markers` argument. The format is `markers=style settings|first location|next location|...` 90 90 ([https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on]), 91 91 e.g.: `markers="size:mid|label:A|color:blue|50.805935,10.349121"`, creates a blue marker labeled with 'A' at 50.805935,10.349121. Again also addresses can be used to specify locations. 92 92 93 The whole value must be quoted if any commas are included. Multiple `markers` arguments can be given to add markers with different styles. 93 94 94 95 So the following example: 95 96 {{{ 96 [[GoogleStaticMap(center="50.805935,10.349121", zoom=5,size=400x400,markers="color:blue|label:A|50.805935,10.349121",markers="color:green|label:B|50.000000,10.000000|Berlin,Germany",markers="color:yellow|label:C|Regensburg,Germany")]]97 [[GoogleStaticMap(center="50.805935,10.349121", zoom=5, size=400x400, markers="color:blue|label:A|50.805935,10.349121", markers="color:green|label:B|50.000000,10.000000|Berlin,Germany", markers="color:yellow|label:C|Regensburg,Germany")]] 97 98 }}} 98 99 99 100 will result in the following map image: 100 101 101 [[Image(http://maps.google.com/maps/api/staticmap?center=50.805935%2C10.349121&zoom=5&markers=color%3Ablue%7Clabel%3AA%7C50.805935%2C10.349121&markers=color%3Agreen%7Clabel%3AB%7C50.000000%2C10.000000%7CBerlin%2CGermany&markers=color%3Ayellow%7Clabel%3AC%7CRegensburg%2CGermany&hl=en&sensor=false&size=400x400, nolink)]]102 [[Image(http://maps.google.com/maps/api/staticmap?center=50.805935%2C10.349121&zoom=5&markers=color%3Ablue%7Clabel%3AA%7C50.805935%2C10.349121&markers=color%3Agreen%7Clabel%3AB%7C50.000000%2C10.000000%7CBerlin%2CGermany&markers=color%3Ayellow%7Clabel%3AC%7CRegensburg%2CGermany&hl=en&sensor=false&size=400x400, nolink)]] 102 103 103 104 === Paths … … 107 108 == Processor Syntax 108 109 109 While Tracs normal macro syntax (`[[Macro(key=value, key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists.110 While Tracs normal macro syntax (`[[Macro(key=value, key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists. 110 111 This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments. 111 112 … … 116 117 key1=value1 117 118 key2="value 2, with comma" 118 key3=value3, key4=value4119 key3=value3, key4=value4 119 120 }}} 120 121 }}} … … 122 123 is identical to: 123 124 {{{ 124 [[GoogleStaticMap(key1=value1, key2="value 2, with comma",key3=value3,key4=value4)]]125 [[GoogleStaticMap(key1=value1, key2="value 2, with comma", key3=value3, key4=value4)]] 125 126 }}} 126 127 … … 142 143 produces: 143 144 144 [[Image(http://maps.google.com/maps/api/staticmap?center=Germany&markers=label%3AM%7CMunich&markers=label%3AB%7CBerlin&markers=label%3AK%7CCologne&markers=label%3AH%7Ccolor%3Aorange%7CHamburg%7CHannover&markers=size%3Asmall%7Ccolor%3Agreen%7CMannheim%7CStraubing%7CM%C3%BCnster&hl=en&path=Munich%7CBerlin%7CCologne%7CMunich&sensor=false&size=250x300, nolink)]]145 [[Image(http://maps.google.com/maps/api/staticmap?center=Germany&markers=label%3AM%7CMunich&markers=label%3AB%7CBerlin&markers=label%3AK%7CCologne&markers=label%3AH%7Ccolor%3Aorange%7CHamburg%7CHannover&markers=size%3Asmall%7Ccolor%3Agreen%7CMannheim%7CStraubing%7CM%C3%BCnster&hl=en&path=Munich%7CBerlin%7CCologne%7CMunich&sensor=false&size=250x300, nolink)]] 145 146 146 147 == Recent Changes