Changes between Version 24 and Version 25 of GoogleStaticMapMacro


Ignore:
Timestamp:
Jan 17, 2016, 2:24:29 PM (8 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • GoogleStaticMapMacro

    v24 v25  
    1212Please 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.
    1313
    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.
     14The 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.
    1515The AdvParseArgsPlugin is used to allow for quoted argument values and must also be installed.
    1616
     
    6060The 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`.
    6161
    62 Please note, that since v2 an API key is not required anymore 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].
     62Please 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].
    6363
    64 == Usage & Examples
     64== Usage and Examples
    6565
    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.
     66This 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.
    6767
    6868=== Parameters
     
    7070The 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:
    7171 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.
    7373 key:: Sets the API key if not set globally in the config file. Deprecated for macro v1.x / Google API v2.
    7474
    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.
     75All 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.
    7676
    7777For example:
    7878{{{
    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)]]
    8181}}}
    8282
    8383will both result in the following map image:
    8484
    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)]]
    8686
    8787=== Markers
    8888
    89 You can add markers to the static map using the '`markers`' argument. The format is '`markers=style settings|first location|next location|...`'
     89You can add markers to the static map using the `markers` argument. The format is `markers=style settings|first location|next location|...`
    9090([https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on]),
    9191e.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
    9293The whole value must be quoted if any commas are included. Multiple `markers` arguments can be given to add markers with different styles.
    9394
    9495So the following example:
    9596{{{
    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")]]
    9798}}}
    9899
    99100will result in the following map image:
    100101
    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)]]
    102103
    103104=== Paths
     
    107108== Processor Syntax
    108109
    109 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists.
     110While Tracs normal macro syntax (`[[Macro(key=value, key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists.
    110111This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments.
    111112
     
    116117key1=value1
    117118key2="value 2, with comma"
    118 key3=value3,key4=value4
     119key3=value3, key4=value4
    119120}}}
    120121}}}
     
    122123is identical to:
    123124{{{
    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)]]
    125126}}}
    126127
     
    142143produces:
    143144
    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)]]
    145146
    146147== Recent Changes