Changes between Version 18 and Version 19 of GoogleStaticMapMacro
- Timestamp:
- Aug 31, 2010, 4:52:47 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleStaticMapMacro
v18 v19 7 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 8 9 For a dynamic Google map use GoogleMapMacro.9 For a dynamic Google map use the GoogleMapMacro. 10 10 11 The maximum size supported by Google is 640x640 pixels. If a bigger width or height is requested it will be reduced to 640px.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 12 13 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. 13 14 14 == Configuration ==15 To enable this macro put the following into your `trac.ini` configuration file:16 {{{17 [components]18 tracgooglestaticmapmacro.* = enabled19 }}}20 15 21 16 … … 32 27 Download the macro as [download:googlestaticmapmacro/0.11 ZIP-file]. 33 28 34 == Installation & Configuration ==35 29 36 Just copy the [http://trac-hacks.org/browser/googlestaticmapmacro/0.11/googlestaticmap.py?format=raw python file] in the `plugin` directory of your trac installation. 30 == Source == 37 31 38 A different Google Map API key is needed for every web domain which can be [http://code.google.com/apis/maps/signup.html get for free from Google]. 32 You can check out GoogleStaticMapMacro from [http://trac-hacks.org/svn/googlestaticmapmacro here] using Subversion, or [source:googlestaticmapmacro browse the source] with Trac. 33 34 35 == Installation & Configuration ==#config 36 37 Install the plugin [http://trac-hacks.org/#HowdoIinstallthesethings as usual]. 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. … … 43 42 {{{ 44 43 [components] 45 googlestaticmap.* = enabled44 tracgooglestaticmap.* = enabled 46 45 47 46 [googlestaticmap] 48 api_key = <Your Google API key (long hex number)> 47 api_key = <Your Google API key (long hex number)> # not required for API v2 49 48 # Optional settings: 50 49 #default_size = 300x300 51 50 #default_language = de 51 #default_api_version = <1 or 2> # should be 2 for newer installations. Set to 1 if you want to keep older macros unchanged 52 52 }}} 53 53 54 == Source == 54 == Upgrade from older Versions ==#Upgrade 55 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]. 56 The syntax provided by Google has changed between the API versions. In order to provide the newer features but also not break existing macros both API versions are supported using the `api` key. 57 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`. 55 58 56 You can check out GoogleStaticMapMacro from [http://trac-hacks.org/svn/googlestaticmapmacro here] using Subversion, or [source:googlestaticmapmacro browse the source] with Trac. 59 Please note, that since v2 an API key is not required anymore by Google. I'm not sure if this is also true for v1. The trac server specific Google Map API key can be [http://code.google.com/apis/maps/signup.html received from Google for free]. 60 57 61 58 62 == Usage & Examples == 63 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. 64 59 65 === Parameters === 60 See http://code.google.com/apis/maps/documentation/staticmaps/#URL_Parameters for all supported arguments. 61 In addition the image title can be set using a `title` argument. 66 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: 67 title:: Sets the HTML title of the map image. 68 api:: Sets the API version to be used. By default set to "`2`". To reuse the older macros set `api=1` as mentioned earlier. 69 key:: Sets the API key if not set globally in the config file. Deprecated for macro v1.x / Google API v2. 62 70 63 71 The map location must be given in geographic coordinates, not as address.