Changes between Version 48 and Version 49 of GoogleMapMacro
- Timestamp:
- Jan 16, 2016, 8:02:48 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GoogleMapMacro
v48 v49 5 5 == Description 6 6 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 versionof Firefox and MS Internet Explorer are compatible.8 9 For Javascript-less static maps use the similar GoogleStaticMapMacro.7 This 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 9 For Javascript-less static maps, use the similar GoogleStaticMapMacro. 10 10 11 11 Multiple Google Maps on the same wiki page are supported. 12 12 13 13 '''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 the reare 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].14 Tell 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]. 15 15 16 16 The 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. … … 56 56 == Configuration ==#config 57 57 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 foryour Trac project.''' They apply to free and openly accessible Trac projects.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 to your Trac project.''' They apply to free and openly accessible Trac projects. 60 60 61 61 To enable the macro put the below text into your `trac.ini` file, which is located in the `config` directory of your Trac installation. … … 66 66 Server side geocoding is recommended but disabled by default. 67 67 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`.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`. 69 69 70 70 {{{#!ini … … 76 76 ## Server side geocoding (address-to-coordinates conversion) incl. caching (recommended). 77 77 ## 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. 79 79 #geocoding = server 80 80 ## Optional default settings, e.g: … … 86 86 == Usage 87 87 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 commathen 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.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 commas, 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 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. 90 90 91 91 `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"`. … … 95 95 `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. 96 96 `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-map100 * `satellite` Satellite picture101 * `hybrid` Satellite picture with streets as overlay102 * `physical` Terrain map97 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 103 103 `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. 105 105 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]): 106 106 * `LargeMap`: Control with buttons to pan in four directions, and zoom in and zoom out. … … 118 118 An optional marker title can be set which will get displayed when the mouse cursor is over the marker. 119 119 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. 121 121 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. 125 125 126 126 == Processor Syntax … … 128 128 While Tracs normal macro syntax (`[[Macro(key=value,key=value)]]`) is nice for smaller arguments lists it is getting messy for longer lists. 129 129 This macro now also supports the so called ''wiki processor syntax'' (`{{{ <linebreak> #!Macro <linebreak> content <linebreak> }}}`) to allow for multiple lines of arguments. 130 130 131 In this case a line break will be read as a comma: 131 132 {{{ … … 134 135 key1=value1 135 136 key2="value 2, with comma" 136 key3=value3, key4=value4137 key3=value3, key4=value4 137 138 }}} 138 139 }}} 139 140 is identical to: 140 141 {{{ 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)]] 142 143 }}} 143 144 … … 148 149 Please use a colon, not a comma, as separator for the coordinates: 149 150 {{{ 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)]] 152 or 153 [[GoogleMap("50.0:10.0", zoom=10, size=400x400)]] 154 or 155 [[GoogleMap(50.0:10.0, zoom=10, size=400x400)]] 155 156 }}} 156 157 … … 159 160 Please use semicolons, not commas, as separators in the address: 160 161 {{{ 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)]] 163 or 164 [[GoogleMap("Street, City, Country", zoom=10, size=400x400)]] 164 165 or, if you really want to: 165 [[GoogleMap(Street; City; Country, zoom=10,size=400x400)]]166 [[GoogleMap(Street; City; Country, zoom=10, size=400x400)]] 166 167 }}} 167 168 … … 174 175 175 176 If 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. 179 179 {{{ 180 180 [[GoogleMap(center=50.0:10.0,address="Street, City, Country",zoom=10,size=400x400)]] … … 185 185 To show a map with the standard map types where the satellite map is preselected: 186 186 {{{ 187 [[GoogleMap("Street, City, Country", zoom=10,size=400x400,type=satellite)]]187 [[GoogleMap("Street, City, Country", zoom=10, size=400x400, type=satellite)]] 188 188 }}} 189 189 190 190 To only show a satellite map (please note the added '`s`'): 191 191 {{{ 192 [[GoogleMap("Street, City, Country", zoom=10,size=400x400,types=satellite)]]192 [[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=satellite)]] 193 193 }}} 194 194 195 195 To show a map with hybrid and satellite map types (in this order) where the satellite map is preselected: 196 196 {{{ 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)]] 198 198 }}} 199 199 200 200 To show a map with hybrid and satellite map types (in this order) where the hybrid map is preselected: 201 201 {{{ 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)]] 203 or 204 [[GoogleMap("Street, City, Country", zoom=10, size=400x400, types=hybrid:satellite, type=hybrid)]] 205 205 }}} 206 206 … … 209 209 To 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): 210 210 {{{ 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)]] 212 212 }}} 213 213 214 214 The same with hyperlinked markers: 215 215 {{{ 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/)]] 217 217 }}} 218 218