Changes between Version 18 and Version 19 of GoogleStaticMapMacro


Ignore:
Timestamp:
Aug 31, 2010, 4:52:47 PM (14 years ago)
Author:
Martin Scharrer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GoogleStaticMapMacro

    v18 v19  
    77'''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.
    88
    9 For a dynamic Google map use GoogleMapMacro.
     9For a dynamic Google map use the GoogleMapMacro.
    1010
    11 The maximum size supported by Google is 640x640 pixels. If a bigger width or height is requested it will be reduced to 640px.
     11Please 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.
    1212
     13The 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.
    1314
    14 == Configuration ==
    15 To enable this macro put the following into your `trac.ini` configuration file:
    16 {{{
    17 [components]
    18 tracgooglestaticmapmacro.* = enabled
    19 }}}
    2015
    2116
     
    3227Download the macro as [download:googlestaticmapmacro/0.11 ZIP-file].
    3328
    34 == Installation & Configuration ==
    3529
    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 ==
    3731
    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].
     32You 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
     37Install the plugin [http://trac-hacks.org/#HowdoIinstallthesethings as usual].
    3938
    4039To enable the macro put the following into your `trac.ini` file, which is located in the `config` directory of your trac installation.
     
    4342{{{
    4443[components]
    45 googlestaticmap.* = enabled
     44tracgooglestaticmap.* = enabled
    4645
    4746[googlestaticmap]
    48 api_key = <Your Google API key (long hex number)>
     47api_key = <Your Google API key (long hex number)>  # not required for API v2
    4948# Optional settings:
    5049#default_size = 300x300
    5150#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
    5252}}}
    5353
    54 == Source ==
     54== Upgrade from older Versions ==#Upgrade
     55The 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].
     56The 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.
     57The 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`.
    5558
    56 You can check out GoogleStaticMapMacro from [http://trac-hacks.org/svn/googlestaticmapmacro here] using Subversion, or [source:googlestaticmapmacro browse the source] with Trac.
     59Please 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
    5761
    5862== Usage & Examples ==
     63This 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
    5965=== 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.
     66The 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.
    6270
    6371The map location must be given in geographic coordinates, not as address.