Changes between Version 22 and Version 23 of GoogleStaticMapMacro
- Timestamp:
- Aug 24, 2015, 1:03:28 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleStaticMapMacro
v22 v23 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Insert a static Google Map as image3 = Insert a static Google Map as an image 4 4 5 5 == Description 6 6 7 This macro uses the [http ://code.google.com/apis/maps/documentation/staticmaps/Google Map API] to include '''static''' images of maps.7 This macro uses the [https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on Google Map API] to include '''static''' images of maps. 8 8 '''Static''' means that is is only a simple image without any user interaction and not the usual feature-rich dynamic map on http://maps.google.com/. No Javascript is needed to display the map image. 9 9 … … 21 21 22 22 If you have any issues, create a 23 [ http://trac-hacks.org/newticket?component=GoogleStaticMapMacro&owner=martin_snew ticket].23 [/newticket?component=GoogleStaticMapMacro new ticket]. 24 24 25 25 [[TicketQuery(component=GoogleStaticMapMacro&group=type,format=progress)]] … … 37 37 Install the plugin [http://trac-hacks.org/#HowdoIinstallthesethings as usual]. 38 38 39 To enable the macro put the following into your `trac.ini` file, which is located in the `config` directory of your trac installation. 40 You need to restart Trac to reread the macro file and the configuration file. 39 To enable the macro put the following into your `trac.ini` file, which is located in the `config` directory of your Trac installation: 41 40 42 41 {{{#!ini … … 52 51 }}} 53 52 53 You need to restart Trac to reread the macro file and the configuration file. 54 54 55 == Upgrade from older Versions ==#Upgrade 55 56 56 The current version of the macro uses the [http://code.google.com/apis/maps/documentation/staticmaps/ Google Static Map API v2], while older versions used [http://code.google.com/apis/maps/documentation/staticmaps/v1/ API v1]57 ([http://code.google.com/apis/maps/documentation/staticmaps/upgrade.html Upgrade guide]).57 The current version of the macro uses the Google Static Map API v2, while older versions used API v1. To upgrade see 58 [https://developers.google.com/maps/documentation/staticmaps/upgrade?csw=1&safe=on here]. 58 59 The syntax provided by Google has changed between the API versions. To provide the newer features without breaking existing macros, both API versions are supported using the `api` key. 59 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`. 60 61 61 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 [http://code.google.com/apis/maps/signup.htmlprovided by Google for free].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]. 62 63 63 64 == Usage & Examples … … 67 68 === Parameters 68 69 69 The macro accepts the official [http ://code.google.com/apis/maps/documentation/staticmaps/#URL_Parameters Google Static Map argument (see there)] as well as a few internal arguments: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: 70 71 title:: Sets the HTML title of the map image. 71 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. 72 73 key:: Sets the API key if not set globally in the config file. Deprecated for macro v1.x / Google API v2. 73 74 … … 87 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 ([http ://code.google.com/apis/maps/documentation/staticmaps/#Markers details]),90 ([https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on]), 90 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. 91 92 The whole value must be quoted if any commas are included. Multiple `markers` arguments can be given to add markers with different styles. 92 93 93 So ,94 So the following example: 94 95 {{{ 95 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")]] 96 97 }}} 98 97 99 will result in the following map image: 98 100 … … 101 103 === Paths 102 104 103 Paths between locations can be added using the `path` argument which has basically the same syntax as `markers`, except different styles are supported. See [http ://code.google.com/apis/maps/documentation/staticmaps/#Pathsthe Google documentation] for details.105 Paths between locations can be added using the `path` argument which has basically the same syntax as `markers`, except different styles are supported. See [https://developers.google.com/maps/documentation/staticmaps/intro?csw=1&safe=on the Google documentation] for details. 104 106 105 107 == Processor Syntax … … 107 109 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists. 108 110 This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments. 111 109 112 In this case a line break will be read as a comma: 110 113 {{{ … … 116 119 }}} 117 120 }}} 121 118 122 is identical to: 119 123 {{{