Changes between Version 21 and Version 22 of GoogleStaticMapMacro
- Timestamp:
- Apr 16, 2015, 11:37:45 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleStaticMapMacro
v21 v22 1 [[TOC]] 2 = Insert a static Google Map as image = 1 [[PageOutline(2-5,Contents,pullout)]] 3 2 4 == Description == 3 = Insert a static Google Map as image 4 5 == Description 5 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 '''Static''' means that is is only a simple image without any user interaction not the usual feature-rich dynamic map on http://maps.google.com/. The positive side is that no javascript is needed to display the map image.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. 8 9 9 10 For a dynamic Google map use the GoogleMapMacro. 10 11 11 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.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. 12 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 15 The AdvParseArgsPlugin is used to allow for quoted argument values and must also be installed. 15 16 16 17 18 == Bugs/Feature Requests == 17 == Bugs/Feature Requests 19 18 20 19 Existing bugs and feature requests for GoogleStaticMapMacro are … … 24 23 [http://trac-hacks.org/newticket?component=GoogleStaticMapMacro&owner=martin_s new ticket]. 25 24 26 == Download == 25 [[TicketQuery(component=GoogleStaticMapMacro&group=type,format=progress)]] 26 27 == Download 27 28 28 29 Download the macro as [download:googlestaticmapmacro/0.11 ZIP-file]. 29 30 30 31 == Source == 31 == Source 32 32 33 33 You can check out GoogleStaticMapMacro from [http://trac-hacks.org/svn/googlestaticmapmacro here] using Subversion, or [source:googlestaticmapmacro browse the source] with Trac. 34 35 34 36 35 == Installation & Configuration ==#config … … 39 38 40 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 You need to restart trac to reread the macro file and the configuration file.40 You need to restart Trac to reread the macro file and the configuration file. 42 41 43 {{{ 42 {{{#!ini 44 43 [components] 45 44 tracgooglestaticmap.* = enabled … … 54 53 55 54 == 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 57 ([http://code.google.com/apis/maps/documentation/staticmaps/upgrade.html Upgrade guide]). 58 The syntax provided by Google has changed between the API versions. In order to provide the newer features but also not break existing macrosboth API versions are supported using the `api` key.58 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 59 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 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.html provided by Google for free]. 62 62 63 == Usage & Examples 63 64 64 == Usage & Examples ==65 65 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 66 67 === Parameters === 67 === Parameters 68 68 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: 69 70 title:: Sets the HTML title of the map image. … … 83 84 [[Image(http://maps.google.com/staticmap?center=50.805935%2C10.349121&zoom=5&size=400x400,nolink)]] 84 85 86 === Markers 85 87 86 === Markers ===87 88 You can add markers to the static map using the '`markers`' argument. The format is '`markers=style settings|first location|next location|...`' 88 89 ([http://code.google.com/apis/maps/documentation/staticmaps/#Markers details]), … … 98 99 [[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)]] 99 100 100 === Paths === 101 === Paths 102 101 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/#Paths the Google documentation] for details. 102 104 103 == Processor Syntax == 104 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists it is getting messy for longer lists. 105 == Processor Syntax 106 107 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists, it is getting messy for longer lists. 105 108 This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments. 106 109 In this case a line break will be read as a comma: … … 137 140 [[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)]] 138 141 139 140 == Recent Changes == 142 == Recent Changes 141 143 142 144 [[ChangeLog(googlestaticmapmacro, 3)]] 143 145 144 == Author/Contributors ==146 == Author/Contributors 145 147 146 148 '''Author:''' [wiki:martin_s] [[BR]] 147 '''Maintainer:''' [ wiki:martin_s] [[BR]]149 '''Maintainer:''' [[Maintainer]] [[BR]] 148 150 '''Contributors:'''