Changes between Version 48 and Version 49 of GoogleMapMacro


Ignore:
Timestamp:
Jan 16, 2016, 8:02:48 AM (8 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged with pypi

Legend:

Unmodified
Added
Removed
Modified
  • GoogleMapMacro

    v48 v49  
    55== Description
    66
    7 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.
    8 
    9 For Javascript-less static maps use the similar GoogleStaticMapMacro.
     7This macro lets the user insert a full dynamic [http://maps.google.com/ Google Map]. Because a Google map uses Javascript, a [http://local.google.com/support/bin/answer.py?answer=16532&topic=1499 compatible browser] is needed. Newer versions of Firefox and MS Internet Explorer are compatible.
     8
     9For Javascript-less static maps, use the similar GoogleStaticMapMacro.
    1010
    1111Multiple Google Maps on the same wiki page are supported.
    1212
    1313'''Feedback''': I would like to get some [mailto:martin@scharrer-online.de?subject=Feedback%20GoogleMapMacro user feedback] for this macro.
    14 Tell me if you like it or not and what could be better. Feel free to request additional features as long there are supported by the [https://developers.google.com/maps/?csw=1&safe=on Google Maps API] by opening a [/newticket?component=GoogleMapMacro&owner=martin_s&type=enhancement&release=0.11 feature request].
     14Tell me if you like it or not and what could be better. Feel free to request additional features as long they are supported by the [https://developers.google.com/maps/?csw=1&safe=on Google Maps API] by opening a [/newticket?component=GoogleMapMacro&owner=martin_s&type=enhancement&release=0.11 feature request].
    1515
    1616The macro should work both with Trac 0.11 and 0.12. There is only a 0.11 directory which can also be used for Trac 0.12.
     
    5656== Configuration ==#config
    5757
    58 A different [https://developers.google.com/maps/signup?csw=1&safe=on Google Map API key] is needed for every web domain which can be obtained for free from Google.
    59 '''Please check if the Google Map API Terms of Use apply for your Trac project.''' They apply to free and openly accessible Trac projects.
     58A different [https://developers.google.com/maps/signup?csw=1&safe=on Google Map API key] is needed for every web domain, which can be obtained for free from Google.
     59'''Please check if the Google Map API Terms of Use apply to your Trac project.''' They apply to free and openly accessible Trac projects.
    6060
    6161To enable the macro put the below text into your `trac.ini` file, which is located in the `config` directory of your Trac installation.
     
    6666Server side geocoding is recommended but disabled by default.
    6767
    68 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`.
     68You 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`.
    6969
    7070{{{#!ini
     
    7676## Server side geocoding (address-to-coordinates conversion) incl. caching (recommended).
    7777## Please note that this creates a table 'googlemapmacro' in your trac database.
    78 ## Possible settings are 'server' or 'client' (without the quotes). Default is 'client' in order not to change the DB unasked.
     78## Possible settings are 'server' or 'client' (without the quotes). Default is 'client' to inadvertently prevent changing the database.
    7979#geocoding = server
    8080## Optional default settings, e.g:
     
    8686== Usage
    8787
    88 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 (`" "`).
    89 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.
     88The macro knows the following arguments, which can be used in the normal `key1=value1, key2=value2,...` syntax. If a value includes one or more commas, then it must be set in double quotes (`" "`).
     89If a key-less value is given, it will be taken as `center` coordinates if it is 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.
    9090
    9191 `address`:: Sets the center of the map to the given address. The value must be surrounded by quotes if it includes commas, e.g. `"Street, City, Country"`.
     
    9595 `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.
    9696 `size`:: The size either in the format `{width}x{height}` as numbers in pixel: `300x400` means 300px wide and 400px high or
    97           in the format `{width}{unit}:{height}{unit}` where unit can be any CSS unit (em, ex, px, in, cm, mm, pt, pc).
    98  `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):
    99    * `normal` Normal street-map
    100    * `satellite` Satellite picture
    101    * `hybrid` Satellite picture with streets as overlay
    102    * `physical` Terrain map
     97          in the format `{width}{unit}:{height}{unit}`, where unit can be any CSS unit (em, ex, px, in, cm, mm, pt, pc).
     98 `types` (optional):: Sets the map types selectable by the user, separated by colons (`:`). If it is not given, then the standard types of Google Maps are used (Normal, Satellite, Hybrid). The following types are available (values are case-insensitive):
     99   * `normal`: Normal street-map
     100   * `satellite`: Satellite picture
     101   * `hybrid`: Satellite picture with streets as overlay
     102   * `physical`: Terrain map
    103103 `type` (optional):: Sets the initial map type. See the `types` argument for the available types. If this argument is not given the first listed type under `types` is used initially.
    104  `controls` (optional):: Sets the used map controls. Multiple controls can be given, separated by colon ('`:`'). The value is case-insensitive. If not set the controls `MapType` and `LargeMap` are used.
     104 `controls` (optional):: Sets the used map controls. Multiple controls can be given, separated by colon (`:`). The value is case-insensitive. If not set the controls `MapType` and `LargeMap` are used.
    105105 If set but empty no controls are displayed. The following controls are available (descriptions taken from the [http://code.google.com/apis/maps/documentation/reference.html#GControlImpl Google Map API page]):
    106106   * `LargeMap`: Control with buttons to pan in four directions, and zoom in and zoom out.
     
    118118    An optional marker title can be set which will get displayed when the mouse cursor is over the marker.
    119119    From revision [4801] on multiple markers can be given which replaces the `markers` argument.
    120  `markers`:: (Old) Can be used to set multiple markers which are are separated using the '`|`' character.
     120 `markers`:: (Old) Can be used to set multiple markers which are are separated using the `|` character.
    121121    Optional values can be kept empty, e.g.: `"{Address}";;;My Address` would display the address with the title 'My Address'.
    122     Trailing semicolons can be skipped. Addresses, links and titles which include either '`,`', '`;`' or '`|`' must be enclosed in double quotes (`" "`).
    123  `target`:: If set to '`new`' or '`newwindow`' all hyperlinks of the map markers will be opened in a new window (or tab, depending on the browser settings) or in the same window otherwise.
    124  `from`,`to`:: Request driving directions '`from`'->'`to`'. Multiple `to` addresses are allowed. No `address` or `center` need to be given.
     122    Trailing semicolons can be skipped. Addresses, links and titles which include either `,`, `;` or `|` must be enclosed in double quotes (`" "`).
     123 `target`:: If set to `new` or `newwindow` all hyperlinks of the map markers will be opened in a new window (or tab, depending on the browser settings) or in the same window otherwise.
     124 `from`,`to`:: Request driving directions `from` -> `to`. Multiple `to` addresses are allowed. No `address` or `center` need to be given.
    125125
    126126== Processor Syntax
     
    128128While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists it is getting messy for longer lists.
    129129This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments.
     130
    130131In this case a line break will be read as a comma:
    131132{{{
     
    134135key1=value1
    135136key2="value 2, with comma"
    136 key3=value3,key4=value4
     137key3=value3, key4=value4
    137138}}}
    138139}}}
    139140is identical to:
    140141{{{
    141 [[GoogleMap(key1=value1,key2="value 2, with comma",key3=value3,key4=value4)]]
     142[[GoogleMap(key1=value1,key2="value 2, with comma", key3=value3, key4=value4)]]
    142143}}}
    143144
     
    148149Please use a colon, not a comma, as separator for the coordinates:
    149150{{{
    150 [[GoogleMap(center=50.0:10.0,zoom=10,size=400x400)]]
    151 or
    152 [[GoogleMap("50.0:10.0",zoom=10,size=400x400)]]
    153 or
    154 [[GoogleMap(50.0:10.0,zoom=10,size=400x400)]]
     151[[GoogleMap(center=50.0:10.0, zoom=10, size=400x400)]]
     152or
     153[[GoogleMap("50.0:10.0", zoom=10, size=400x400)]]
     154or
     155[[GoogleMap(50.0:10.0, zoom=10, size=400x400)]]
    155156}}}
    156157
     
    159160Please use semicolons, not commas, as separators in the address:
    160161{{{
    161 [[GoogleMap(address="Street, City, Country",zoom=10,size=400x400)]]
    162 or
    163 [[GoogleMap("Street, City, Country",zoom=10,size=400x400)]]
     162[[GoogleMap(address="Street, City, Country", zoom=10, size=400x400)]]
     163or
     164[[GoogleMap("Street, City, Country", zoom=10, size=400x400)]]
    164165or, if you really want to:
    165 [[GoogleMap(Street; City; Country,zoom=10,size=400x400)]]
     166[[GoogleMap(Street; City; Country, zoom=10, size=400x400)]]
    166167}}}
    167168
     
    174175
    175176If both address and center coordinates are given, then the result depends on the [#config `geocoding` setting]:
    176  `server`:: The address is resolved on the trac server and the coordinates are completely ignored.
    177  `client`:: The map is first centered at the given coordinates and then moved to the given address after (and if) it was
    178             resolved by the client-side !JavaScript code.
     177 `server`:: The address is resolved on the Trac server and the coordinates are completely ignored.
     178 `client`:: The map is first centered at the given coordinates and then moved to the given address after (and if) it was resolved by the client-side !JavaScript code.
    179179{{{
    180180[[GoogleMap(center=50.0:10.0,address="Street, City, Country",zoom=10,size=400x400)]]
     
    185185To show a map with the standard map types where the satellite map is preselected:
    186186{{{
    187 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,type=satellite)]]
     187[[GoogleMap("Street, City, Country", zoom=10, size=400x400, type=satellite)]]
    188188}}}
    189189
    190190To only show a satellite map (please note the added '`s`'):
    191191{{{
    192 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,types=satellite)]]
     192[[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=satellite)]]
    193193}}}
    194194
    195195To show a map with hybrid and satellite map types (in this order) where the satellite map is preselected:
    196196{{{
    197 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,types=hybrid:satellite,type=satellite)]]
     197[[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=hybrid:satellite, type=satellite)]]
    198198}}}
    199199
    200200To show a map with hybrid and satellite map types (in this order) where the hybrid map is preselected:
    201201{{{
    202 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,types=hybrid:satellite)]]
    203 or
    204 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,types=hybrid:satellite,type=hybrid)]]
     202[[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=hybrid:satellite)]]
     203or
     204[[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=hybrid:satellite, type=hybrid)]]
    205205}}}
    206206
     
    209209To 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):
    210210{{{
    211 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,markers=center;A|"Next street, City, Country";B|10.243:23.343;C)]]
     211[[GoogleMap("Street, City, Country", zoom=10, size=400x400, markers=center;A|"Next street, City, Country";B|10.243:23.343;C)]]
    212212}}}
    213213
    214214The same with hyperlinked markers:
    215215{{{
    216 [[GoogleMap("Street, City, Country",zoom=10,size=400x400,markers=center;A;wiki:MyWikiPage|"Next street, City, Country";B;ticket:1|10.243:23.343;C;http://www.example.com/)]]
     216[[GoogleMap("Street, City, Country", zoom=10, size=400x400, markers=center;A;wiki:MyWikiPage|"Next street, City, Country";B;ticket:1|10.243:23.343;C;http://www.example.com/)]]
    217217}}}
    218218